X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=fileops.c;h=ae9a7df135c6d48da8b0ebc0b96722f425f57466;hb=f3530d8198251b72d01da9a07b1fa518446ec0f0;hp=ca4903fe0987aef66da165e446573ebbcd0c67d3;hpb=a91c5f78701b90c47a08daa15569ef64c6194504;p=debian%2Fsudo diff --git a/fileops.c b/fileops.c index ca4903f..ae9a7df 100644 --- a/fileops.c +++ b/fileops.c @@ -44,7 +44,7 @@ # include #endif #ifndef HAVE_TIMESPEC -# include +# include "emul/timespec.h" #endif #include "sudo.h" @@ -71,13 +71,13 @@ touch(fd, path, tvp) #if defined(HAVE_FUTIME) || defined(HAVE_FUTIMES) if (fd != -1) - return(futimes(fd, tvp ? times : NULL)); + return futimes(fd, tvp ? times : NULL); else #endif if (path != NULL) - return(utimes(path, tvp ? times : NULL)); + return utimes(path, tvp ? times : NULL); else - return(-1); + return -1; } /* @@ -102,7 +102,7 @@ lock_file(fd, lockit) op = F_ULOCK; break; } - return(lockf(fd, op, 0) == 0); + return lockf(fd, op, 0) == 0; } #elif HAVE_FLOCK int @@ -123,7 +123,7 @@ lock_file(fd, lockit) op = LOCK_UN; break; } - return(flock(fd, op) == 0); + return flock(fd, op) == 0; } #else int @@ -142,9 +142,9 @@ lock_file(fd, lockit) lock.l_whence = SEEK_SET; func = (lockit == SUDO_LOCK) ? F_SETLKW : F_SETLK; - return(fcntl(fd, func, &lock) == 0); + return fcntl(fd, func, &lock) == 0; #else - return(TRUE); + return TRUE; #endif } #endif @@ -170,8 +170,8 @@ sudo_parseln(fp) len = strlen(buf); while (len > 0 && isspace((unsigned char)buf[len - 1])) buf[--len] = '\0'; - for (cp = buf; isblank(*cp); cp++) + for (cp = buf; isblank((unsigned char)*cp); cp++) continue; } - return(cp); + return cp; }