X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fpinstall%2Finstall.c;h=36b3e265e91eb892e878826754aa1e25adbc3cf3;hp=53e4ed88a2ecf4347475d10141d189e89cb8e930;hb=6bfdf43e9f963abd1e6801edf254b3dc159cc100;hpb=0c1eb3a380a7ec7042167d76faf9193f2e9cd43a diff --git a/src/pinstall/install.c b/src/pinstall/install.c index 53e4ed8..36b3e26 100644 --- a/src/pinstall/install.c +++ b/src/pinstall/install.c @@ -77,15 +77,18 @@ Generic install command. Options are: #ifdef AFS_HPUX_ENV #include #endif +#include +#include +#include struct stat istat, ostat; extern int errno; extern int sys_nerr; -#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD40_ENV) +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) extern char *sys_errlist[]; #endif -#if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) +#if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) extern struct passwd *getpwnam(); int stripcalled = 0; #endif @@ -115,9 +118,9 @@ static char *strrpbrk (s, set) int i; bzero (sets, sizeof(sets)); - while (*set) sets[*set++] = 1; + while (*set) sets[(int) *set++] = 1; i = strlen (s); - while (i > 0) if (sets[s[--i]]) return &s[i]; + while (i > 0) if (sets[(int)s[--i]]) return &s[i]; return 0; } @@ -126,23 +129,26 @@ char *ErrorString(aerrno) static char tbuffer[100]; if (aerrno < 0 || aerrno >= sys_nerr) { sprintf(tbuffer, "undefined error code %d", aerrno); - return tbuffer; + } else { + strcpy(tbuffer, sys_errlist[aerrno]); } - return sys_errlist[aerrno]; + return tbuffer; } +int stripName(aname) char *aname; {if (rindex(aname, '.') == 0) return 1; else return 0; } +int atoo(astr) register char *astr; {register afs_int32 value; register char tc; value = 0; - while (tc = *astr++) + while ((tc = *astr++)) {value <<= 3; value += tc-'0'; } @@ -154,7 +160,7 @@ atoo(astr) * Implementation lifted from that for AIX 3.1, since there didn't seem to be any * reason why it wouldn't work. */ -static +static int quickStrip (iname, oname, ignored, copy_only) char *iname, *oname; { int pid, status; @@ -216,7 +222,7 @@ char *iname, *oname; { strip[1] = oname; #ifdef AFS_SUN5_ENV #define STRIP_BIN "/usr/ccs/bin/strip" -#elif defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) +#elif defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #define STRIP_BIN "/usr/bin/strip" #else #define STRIP_BIN "/bin/strip" @@ -248,6 +254,7 @@ char *iname, *oname; { * Since /bin/strip will make that call for us, we will lie so that * it has a chance. */ +int AIXobject(ignored) { return !0; @@ -451,16 +458,17 @@ static int quickStrip (afd, asize) #include "AFS_component_version_number.c" +int main (argc, argv) int argc; char **argv; { int setOwner, setMode, setGroup, ifd, ofd; - afs_int32 mode, owner, group; + afs_int32 mode=0, owner, group; struct passwd *tpw; struct group *tgp; char *fnames[MAXFILES], *newNames[MAXFILES]; - afs_int32 rcode, code, newcode; + afs_int32 rcode, code; char *dname; char pname[1024]; #if defined (AFS_HPUX_ENV) @@ -468,7 +476,10 @@ main (argc, argv) #endif /* AFS_HPUX_ENV */ char pnametmp[1024]; int pnamelen; +#if defined (AFS_AIX_ENV) || defined(AFS_FBSD_ENV) + afs_int32 newcode; static char diskBuffer[BUFSIZE]; /* must be static to avoid compiler bugs for large stuff */ +#endif char myHostName[100]; struct timeval tvp[2]; int isDir; @@ -679,7 +690,7 @@ main (argc, argv) #if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) stripcalled = 0; if (strip == 1 || - (strip == -1 && ((istat.st_mode & 0111) == 0111) && stripName(newNames[i])) && AIXobject(fnames[i])) + ((strip == -1 && ((istat.st_mode & 0111) == 0111) && stripName(newNames[i])) && AIXobject(fnames[i]))) stripcalled = 1; if (!stripcalled) { /* Simply copy target to dest */