about summary refs log tree commit diff
path: root/src/libnmt-newt/nmt-newt-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnmt-newt/nmt-newt-utils.c')
-rw-r--r--src/libnmt-newt/nmt-newt-utils.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/libnmt-newt/nmt-newt-utils.c b/src/libnmt-newt/nmt-newt-utils.c
index 8eeee202..36a47b2b 100644
--- a/src/libnmt-newt/nmt-newt-utils.c
+++ b/src/libnmt-newt/nmt-newt-utils.c
@@ -416,9 +416,18 @@ nmt_newt_edit_string(const char *data)
 
     len = data ? strlen(data) : 0;
     while (len) {
-        do
-            nwrote = write(fd, data, len);
-        while (nwrote == -1 && errno == EINTR);
+        nwrote = write(fd, data, len);
+
+        if (nwrote == -1) {
+            if (errno == EINTR) {
+                continue;
+            }
+
+            nmt_newt_message_dialog(_("Could not write to temporary file: %s"),
+                                    nm_strerror_native(errno));
+            nm_close(fd);
+            goto done;
+        }
 
         len -= nwrote;
         data += nwrote;