OSDN Git Service

fs_ext2.c (fs_expand, fs_shrink),
authorTheodore Ts'o <tytso@mit.edu>
Fri, 8 Nov 2002 19:10:15 +0000 (14:10 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 8 Nov 2002 19:10:15 +0000 (14:10 -0500)
fsimext2.c (fsim_mkfs, fsim_fsck): Inform the user if e2fsck,
mke2fs or resize2fs dies with a signal, or if the exit
with a non-zero exit status.

lib/evms/ChangeLog
lib/evms/fs_ext2.c
lib/evms/fsimext2.c

index a74a8d5..96dbd32 100644 (file)
@@ -1,5 +1,10 @@
 2002-11-08  Theodore Ts'o  <tytso@mit.edu>
 
+       * fs_ext2.c (fs_expand, fs_shrink), 
+         fsimext2.c (fsim_mkfs, fsim_fsck): Inform the user if e2fsck, 
+               mke2fs or resize2fs dies with a signal, or if the exit 
+               with a non-zero exit status.
+
        * fsimext2.c (set_mkfs_options): If the hard sector size is 1024,
                don't force a blocksize of 1024; there's no need to do so.
 
index c327600..17c1c88 100644 (file)
@@ -372,9 +372,15 @@ static int fs_expand( logical_volume_t * volume,
                }
                if ( WIFEXITED(status) ) {
                        /* get expand exit code */
-                       LOG("Expand completed with rc = %d \n",status);
                        rc = WEXITSTATUS(status);
+                       if (rc)
+                               LOG("Expand completed successfully\n");
+                       else
+                               LOG("Expand completed with rc = %d\n", status);
                } else {
+                       if (WIFSIGNALED(status))
+                               LOG("Expand died with signal %d",
+                                   WTERMSIG(status));
                        rc = EINTR;
                }
        }
@@ -529,9 +535,15 @@ static int fs_shrink( logical_volume_t * volume,
                }
                if ( WIFEXITED(status) ) {
                        /* get shrink exit code */
-                       LOG("Shrink completed with rc = %d \n",status);
                        rc = WEXITSTATUS(status);
+                       if (rc) 
+                               LOG("Shrink completed successfully\n");
+                       else
+                               LOG("Shrink completed with rc = %d\n",status);
                } else {
+                       if (WIFSIGNALED(status))
+                               LOG("Shrink died with signal %d",
+                                   WTERMSIG(status));
                        rc = EINTR;
                }
        }
index a3660ff..344364b 100644 (file)
@@ -139,7 +139,12 @@ int fsim_mkfs(logical_volume_t * volume, option_array_t * options )
             if ( WIFEXITED(status) ) {
                 /* get mke2fs exit code */
                 rc = WEXITSTATUS(status);
+               if (rc)
+                       LOG("mke2fs exited with status %d", rc);
             } else {
+                   if (WIFSIGNALED(status))
+                           LOG("mke2fs died with signal %d",
+                               WTERMSIG(status));
                    rc = EINTR;
            }
     }
@@ -358,10 +363,13 @@ int fsim_fsck(logical_volume_t * volume, option_array_t * options,
                if ( WIFEXITED(status) ) {
                        /* get e2fsck exit code */
                        *ret_status = WEXITSTATUS(status);
-                       LOG("e2fsck completed with exit code %d \n",
+                       LOG("e2fsck completed with exit code %d\n",
                            *ret_status);
                        rc = 0;
                } else {
+                       if (WIFSIGNALED(status))
+                               LOG("e2fsck died with signal %d",
+                                   WTERMSIG(status));
                        rc = EINTR;
                }
        }