Run Nindent on com32/lib/sys/fstat.c
authorH. Peter Anvin <hpa@zytor.com>
Fri, 29 May 2009 22:10:25 +0000 (15:10 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 29 May 2009 22:10:25 +0000 (15:10 -0700)
Automatically reformat com32/lib/sys/fstat.c using Nindent.

Do this for all files except HDT, gPXE and externally maintained
libraries (zlib, tinyjpeg, libpng).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/lib/sys/fstat.c

index ef5e20d..6a85393 100644 (file)
 
 int fstat(int fd, struct stat *buf)
 {
-  struct file_info *fp = &__file_info[fd];
+    struct file_info *fp = &__file_info[fd];
 
-  if ( fd >= NFILES || !fp->iop ) {
-    errno = EBADF;
-    return -1;
-  }
+    if (fd >= NFILES || !fp->iop) {
+       errno = EBADF;
+       return -1;
+    }
 
-  if ( fp->iop->flags & __DEV_FILE ) {
-    if ( fp->i.length == (uint32_t)-1 ) {
-      /* File of unknown length, report it as a socket
-        (it probably really is, anyway!) */
-      buf->st_mode = S_IFSOCK | 0444;
-      buf->st_size = 0;
+    if (fp->iop->flags & __DEV_FILE) {
+       if (fp->i.length == (uint32_t) - 1) {
+           /* File of unknown length, report it as a socket
+              (it probably really is, anyway!) */
+           buf->st_mode = S_IFSOCK | 0444;
+           buf->st_size = 0;
+       } else {
+           buf->st_mode = S_IFREG | 0444;
+           buf->st_size = fp->i.length;
+       }
     } else {
-      buf->st_mode = S_IFREG | 0444;
-      buf->st_size = fp->i.length;
+       buf->st_mode = S_IFCHR | 0666;
+       buf->st_size = 0;
     }
-  } else {
-    buf->st_mode = S_IFCHR | 0666;
-    buf->st_size = 0;
-  }
 
-  return 0;
+    return 0;
 }