Whamcloud - gitweb
fs_ext2.c (fs_expand, fs_shrink): Synchronize with EVMS CVS rev
authorTheodore Ts'o <tytso@mit.edu>
Fri, 8 Nov 2002 16:54:29 +0000 (11:54 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 8 Nov 2002 16:54:29 +0000 (11:54 -0500)
1.11 (2002/8/27).  Read from the resize2fs output in
non-blocking mode, so the GUI continues to updates the window.

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

index 8cf2a4a..0a3bde8 100644 (file)
@@ -1,5 +1,9 @@
 2002-11-08  Theodore Ts'o  <tytso@mit.edu>
 
+       * fs_ext2.c (fs_expand, fs_shrink): Synchronize with EVMS CVS rev
+               1.11 (2002/8/27).  Read from the resize2fs output in 
+               non-blocking mode, so the GUI continues to updates the window.
+
        * fsimext2.h: Synchronize with EVMS CVS rev 1.8 (2002/8/29).
                Change all __uXX's to u_intXX_t's.
 
index 3a7b526..0b8f6ee 100644 (file)
@@ -25,6 +25,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <plugin.h>
 #include <sys/wait.h>
 #include "fsimext2.h"
@@ -346,6 +347,7 @@ static int fs_expand( logical_volume_t * volume,
                close(fds2[1]);
 
                /* wait for child to complete */
+               fcntl(fds2[0], F_SETFL, fcntl(fds2[0], F_GETFL,0) | O_NONBLOCK);
                while (!(pidf = waitpid( pidf, &status, WNOHANG ))) {
                        bytes_read = read(fds2[0],buffer,MAX_USER_MESSAGE_LEN);
                        if (bytes_read > 0) {
@@ -499,6 +501,7 @@ static int fs_shrink( logical_volume_t * volume,
                close(fds2[1]);
                write(fds1[1], "Yes\n",4);  
 
+               fcntl(fds2[0], F_SETFL, fcntl(fds2[0], F_GETFL,0) | O_NONBLOCK);
                /* wait for child to complete */
                while (!(pidf = waitpid( pidf, &status, WNOHANG ))) {
                        bytes_read = read(fds2[0],buffer,MAX_USER_MESSAGE_LEN);