[OpenAFS-devel] small patch for makefiles, getwd(), gets()
Nathan Neulinger
nneul@umr.edu
Thu, 2 Nov 2000 08:35:55 -0600
--6c2NcOVqGQ03X4Wi
Content-Type: text/plain; charset*=ansi-x3-4-1968''us-ascii
Content-Disposition: inline
Changes:
Fixes a DESTDIR= in the hpux makefile
Comments out the CC definitions in two MakefileProto.SOLARIS
files, since that is inherited from the src/config/Makefile.sun4x_* makefile
Changes all getwd() calls to getcwd() calls
Changes some gets() calls to fgets() calls, there are still a few
------------------------------------------------------------
Nathan Neulinger EMail: nneul@umr.edu
University of Missouri - Rolla Phone: (573) 341-4841
Computing Services Fax: (573) 341-4216
--6c2NcOVqGQ03X4Wi
Content-Type: text/plain; charset*=ansi-x3-4-1968''us-ascii
Content-Disposition: attachment; filename*=ansi-x3-4-1968''umr%2Ediff
diff -Nur orig-src/ftpd43+/ftpd.c src/ftpd43+/ftpd.c
--- orig-src/ftpd43+/ftpd.c Fri Oct 13 10:33:48 2000
+++ src/ftpd43+/ftpd.c Thu Nov 2 08:18:43 2000
@@ -1738,7 +1738,7 @@
{
char path[MAXPATHLEN + 1];
extern char *getwd();
- if (getwd(path) == (char *)NULL)
+ if (getcwd(path, MAXPATHLEN+1) == (char *)NULL)
reply(550, "%s.", path);
else
reply(257, "\"%s\" is current directory.", path);
diff -Nur orig-src/libafs/MakefileProto.HPUX src/libafs/MakefileProto.HPUX
--- orig-src/libafs/MakefileProto.HPUX Thu Oct 19 12:27:16 2000
+++ src/libafs/MakefileProto.HPUX Wed Nov 1 08:53:26 2000
@@ -104,7 +104,8 @@
64) bopts="$(KDEFS_64)"; bsuff="64";; \
esac; \
cd $$dir; \
- $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" DESTDIR=../${DESTDIR} libafs || exit $$?; \
+ #$(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" DESTDIR=../${DESTDIR} libafs || exit $$?; \
+ $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" DESTDIR=${DESTDIR} libafs || exit $$?; \
cd ..; \
done; \
done
diff -Nur orig-src/libafs/MakefileProto.SOLARIS src/libafs/MakefileProto.SOLARIS
--- orig-src/libafs/MakefileProto.SOLARIS Thu Oct 26 10:14:20 2000
+++ src/libafs/MakefileProto.SOLARIS Thu Nov 2 08:14:44 2000
@@ -25,7 +25,7 @@
DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
LD = /usr/ccs/bin/ld
LORDER = /usr/ccs/bin/lorder
-CC = /opt/SUNWspro/bin/cc
+#CC = /opt/SUNWspro/bin/cc
KDEFS= -Dsun4c -DSUN4C_60 -DNFSCLIENT -DSYSACCT -DOLDSCSI -DVDDRV -D_KERNEL \
-DSYSV -dn ${ARCH_DEFS}
diff -Nur orig-src/libuafs/MakefileProto.SOLARIS src/libuafs/MakefileProto.SOLARIS
--- orig-src/libuafs/MakefileProto.SOLARIS Fri Oct 13 10:34:02 2000
+++ src/libuafs/MakefileProto.SOLARIS Thu Nov 2 08:14:49 2000
@@ -8,7 +8,7 @@
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
# System specific build commands and flags
-CC = /opt/SUNWspro/bin/cc
+#CC = /opt/SUNWspro/bin/cc
DEFINES= -D_REENTRANT -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
OPTF=-O
diff -Nur orig-src/sys/rmtsysc.c src/sys/rmtsysc.c
--- orig-src/sys/rmtsysc.c Fri Oct 13 10:41:09 2000
+++ src/sys/rmtsysc.c Thu Nov 2 08:19:20 2000
@@ -226,7 +226,7 @@
if (path) {
if (*path != '/') {
/* assuming relative path name */
- if (getwd(pathname) == NULL) {
+ if (getcwd(pathname, 256) == NULL) {
free(inbuffer);
printf("getwd failed; exiting\n");
exit(1);
diff -Nur orig-src/venus/test/fulltest.c src/venus/test/fulltest.c
--- orig-src/venus/test/fulltest.c Fri Oct 13 10:41:16 2000
+++ src/venus/test/fulltest.c Thu Nov 2 08:19:42 2000
@@ -28,7 +28,7 @@
dirName = argv[1];
mkdir(dirName, 0777);
if (chdir(dirName) < 0) return perror("chdir");
- if (getwd(tempName) == 0) {
+ if (getcwd(tempName, 1024) == 0) {
return printf("Could not get working dir.\n");
}
/* now create some files */
diff -Nur orig-src/vlserver/vlclient.c src/vlserver/vlclient.c
--- orig-src/vlserver/vlclient.c Wed Oct 25 11:15:01 2000
+++ src/vlserver/vlclient.c Thu Nov 2 08:24:48 2000
@@ -283,7 +283,7 @@
bzero(&updateentry, sizeof(updateentry));
bzero(&listbyattributes, sizeof(listbyattributes));
printf("vl> ");
- if (gets(line) == NULL) {
+ if (fgets(line, 500, stdin) == NULL) {
printf("\n");
exit(0);
} else {
diff -Nur orig-src/volser/restorevol.c src/volser/restorevol.c
--- orig-src/volser/restorevol.c Fri Oct 13 10:41:20 2000
+++ src/volser/restorevol.c Thu Nov 2 08:20:11 2000
@@ -788,7 +788,7 @@
* or -dir or the current working dir.
*/
if ((as->parms[3].items) || (as->parms[1].items)) { /* -mountpoint or -dir*/
- t = (char *)getwd(thisdir); /* remember current dir */
+ t = (char *)getcwd(thisdir, MAXPATHLEN); /* remember current dir */
if (!t) {
fprintf(stderr, "Cannot get pathname of current working directory: %s\n",
thisdir);
--6c2NcOVqGQ03X4Wi--