[OpenAFS-devel] usd_FileClose

Jim Rees rees@umich.edu
Wed, 03 Mar 2004 12:42:38 -0500


Anyone object to this?

Index: src/usd/usd_file.c
===================================================================
RCS file: /cvs/openafs/src/usd/usd_file.c,v
retrieving revision 1.13
diff -u -r1.13 usd_file.c
--- src/usd/usd_file.c	15 Jul 2003 23:17:10 -0000	1.13
+++ src/usd/usd_file.c	3 Mar 2004 17:40:53 -0000
@@ -306,17 +306,9 @@
     if (usd->openFlags & (O_WRONLY | O_RDWR)) {
 	int mode;
 	code = usd_FileIoctl(usd, USD_IOCTL_GETTYPE, &mode);
-	if (code == 0) {
-	    if (S_ISBLK(mode)
-#ifndef AFS_AIX_ENV
-		/* on AIX3.1 can't fsync raw disk device */
-		|| S_ISCHR(mode)
-#endif
-		) {
-		code = fsync(fd);
-		if (code)
-		    code = errno;
-	    }
+	if (code == 0 && S_ISBLK(mode)) {
+	    if (fsync(fd) < 0)
+		code = errno;
 	}
     }