X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/684576ff457db7cbebcb6e00f840ed044ccf2e6f..34aa616d41ad3a1b099d094a98b82b3505c735ed:/popt/popt.c diff --git a/popt/popt.c b/popt/popt.c index fcf671ca..a2c24e78 100644 --- a/popt/popt.c +++ b/popt/popt.c @@ -392,7 +392,6 @@ static int execCommand(poptContext con) poptItem item = con->doExec; const char ** argv; int argc = 0; - int rc; if (item == NULL) /*XXX can't happen*/ return POPT_ERROR_NOARG; @@ -432,8 +431,9 @@ static int execCommand(poptContext con) argv[argc] = NULL; + { #ifdef __hpux - rc = setresgid(getgid(), getgid(),-1); + int rc = setresgid(getgid(), getgid(),-1); if (rc) return POPT_ERROR_ERRNO; rc = setresuid(getuid(), getuid(),-1); if (rc) return POPT_ERROR_ERRNO; @@ -444,12 +444,12 @@ static int execCommand(poptContext con) * XXX from Norbert Warmuth */ #if defined(HAVE_SETUID) - rc = setgid(getgid()); + int rc = setgid(getgid()); if (rc) return POPT_ERROR_ERRNO; rc = setuid(getuid()); if (rc) return POPT_ERROR_ERRNO; #elif defined (HAVE_SETREUID) - rc = setregid(getgid(), getgid()); + int rc = setregid(getgid(), getgid()); if (rc) return POPT_ERROR_ERRNO; rc = setreuid(getuid(), getuid()); if (rc) return POPT_ERROR_ERRNO; @@ -457,6 +457,7 @@ static int execCommand(poptContext con) ; /* Can't drop privileges */ #endif #endif + } if (argv[0] == NULL) return POPT_ERROR_NOARG; @@ -471,7 +472,7 @@ if (_popt_debug) } #endif - rc = execvp(argv[0], (char *const *)argv); + execvp(argv[0], (char *const *)argv); return POPT_ERROR_ERRNO; } @@ -965,10 +966,10 @@ int poptGetNextOpt(poptContext con) if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_DOUBLE) { *((double *) opt->arg) = aDouble; } else { -#define _ABS(a) ((((a) - 0.0) < DBL_EPSILON) ? -(a) : (a)) - if ((_ABS(aDouble) - FLT_MAX) > DBL_EPSILON) +#define MY_ABS(a) ((((a) - 0.0) < DBL_EPSILON) ? -(a) : (a)) + if ((MY_ABS(aDouble) - FLT_MAX) > DBL_EPSILON) return POPT_ERROR_OVERFLOW; - if ((FLT_MIN - _ABS(aDouble)) > DBL_EPSILON) + if ((FLT_MIN - MY_ABS(aDouble)) > DBL_EPSILON) return POPT_ERROR_OVERFLOW; *((float *) opt->arg) = aDouble; }