diff options
author | Bardur Arantsson <bardur@scientician.net> | 2014-12-16 08:03:10 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2014-12-16 08:03:10 +0100 |
commit | 1317b79a18d283e5a953005cb4a57b600dedadc0 (patch) | |
tree | e26755772ec30a716d78150f1aa36c9639796b0e /src/util.cc | |
parent | 63dc88888692fbeddb4c0a2ec99af3cd708276eb (diff) |
Remove lots of obsolete platform defines
Diffstat (limited to 'src/util.cc')
-rw-r--r-- | src/util.cc | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/util.cc b/src/util.cc index da94f171..57bc03de 100644 --- a/src/util.cc +++ b/src/util.cc @@ -566,70 +566,6 @@ return (open(buf, flags | O_BINARY, 0)); /* -* Hack -- attempt to lock a file descriptor -* -* Legal lock types -- F_UNLCK, F_RDLCK, F_WRLCK -*/ -errr fd_lock(int fd, int what) -{ - /* XXX XXX */ - what = what ? what : 0; - - /* Verify the fd */ - if (fd < 0) return ( -1); - -#ifdef SET_UID - -# ifdef USG - -# if defined(F_ULOCK) && defined(F_LOCK) - - /* Un-Lock */ - if (what == F_UNLCK) - { - /* Unlock it, Ignore errors */ - lockf(fd, F_ULOCK, 0); - } - - /* Lock */ - else - { - /* Lock the score file */ - if (lockf(fd, F_LOCK, 0) != 0) return (1); - } - -# endif - -# else - -# if defined(LOCK_UN) && defined(LOCK_EX) - - /* Un-Lock */ - if (what == F_UNLCK) - { - /* Unlock it, Ignore errors */ - (void)flock(fd, LOCK_UN); - } - - /* Lock */ - else - { - /* Lock the score file */ - if (flock(fd, LOCK_EX) != 0) return (1); - } - -# endif - -# endif - -#endif - - /* Success */ - return (0); -} - - -/* * Hack -- attempt to seek on a file descriptor */ errr fd_seek(int fd, huge n) |