about summary refs log tree commit diff
path: root/src/libnmt-newt
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2024-07-05 18:15:24 +0200
committerMichael Biebl <biebl@debian.org>2024-07-05 18:15:24 +0200
commit3501890d52b1070bec5b36325af0290511ff96a1 (patch)
treeb2c9635598790196a46f89889fe8c086f2962510 /src/libnmt-newt
parent080a37f1e51bb6f31f8c1f275cbf8a5d4784c15f (diff)
parent58affb29b8386d6d26359da604a64fefe7ae0a60 (diff)
Update upstream source from tag 'upstream/1.48.4'
Update to upstream version '1.48.4'
with Debian dir 83f88fa0896dc9787d43084c4371c772f9ec0226
Diffstat (limited to 'src/libnmt-newt')
-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;