]> granicus.if.org Git - sudo/commitdiff
Fix a pasto in flock-style unlocking and include <sys/file.h> for flock
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 4 Apr 2001 17:17:04 +0000 (17:17 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 4 Apr 2001 17:17:04 +0000 (17:17 +0000)
on older systems; twetzel@gwdg.de

fileops.c

index 3801cc2356ccfaac05d736fe0fc40477ba7d2fea..78b05c679e68cfd25607bdf7b4c5b78d18378ac1 100644 (file)
--- a/fileops.c
+++ b/fileops.c
@@ -42,6 +42,9 @@
 #include <time.h>
 #include <sys/types.h>
 #include <sys/param.h>
+#ifdef HAVE_FLOCK
+#include <sys/file.h>
+#endif /* HAVE_FLOCK */
 #ifdef HAVE_UTIME
 # ifdef HAVE_UTIME_H
 #  include <utime.h>
@@ -119,7 +122,7 @@ lock_file(fd, lockit)
            op = LOCK_EX | LOCK_NB;
            break;
        case SUDO_UNLOCK:
-           op = LOCK_EX;
+           op = LOCK_UN;
            break;
     }
     return(flock(fd, op) == 0);