diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-08-23 12:39:42 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-08-23 12:39:42 +0000 |
commit | 274bd0216e1c7420f34ad276e55239e80053c073 (patch) | |
tree | 91f18c021fc5d3d90df407e74972be456813a509 /mx.c | |
parent | 3f5d80031e778db8e9db52166772d4a8f3bf419d (diff) |
Remove a couple of NFS-related hacks which seem to be unnecessary.
Diffstat (limited to 'mx.c')
-rw-r--r-- | mx.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -295,12 +295,12 @@ void mx_unlink_empty (const char *path) { int fd; #ifndef USE_DOTLOCK - char b; + struct stat sb; #endif if ((fd = open (path, O_RDWR)) == -1) return; - + if (mx_lock_file (path, fd, 1, 0, 1) == -1) { close (fd); @@ -310,11 +310,12 @@ void mx_unlink_empty (const char *path) #ifdef USE_DOTLOCK invoke_dotlock (path, DL_FL_UNLINK, 1); #else - if (read (fd, &b, 1) != 1) + if (fstat (fd, &sb) == 0 && sb.st_size == 0) unlink (path); #endif mx_unlock_file (path, fd, 0); + close (fd); } /* try to figure out what type of mailbox ``path'' is |