X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fpinstall%2Finstall.c;h=36b3e265e91eb892e878826754aa1e25adbc3cf3;hp=004a9c1107597e1033d15a9a80a7fd0cef2eebe6;hb=6bfdf43e9f963abd1e6801edf254b3dc159cc100;hpb=fb5bcd00fc6f1560d7d02115a0b5beaa3014a0e7 diff --git a/src/pinstall/install.c b/src/pinstall/install.c index 004a9c1..36b3e26 100644 --- a/src/pinstall/install.c +++ b/src/pinstall/install.c @@ -66,21 +66,29 @@ Generic install command. Options are: #include #include #else +#ifdef AFS_DARWIN_ENV +#include +#include +#else #include #include #endif +#endif #ifdef AFS_HPUX_ENV #include #endif +#include +#include +#include struct stat istat, ostat; extern int errno; extern int sys_nerr; -#ifndef AFS_LINUX20_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) +#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 @@ -110,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; } @@ -121,35 +129,38 @@ 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'; } return value; } -#if defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) /* * 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; @@ -211,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) +#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" @@ -243,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; @@ -446,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) @@ -463,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; @@ -671,10 +687,10 @@ main (argc, argv) continue; } } -#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) +#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 */