Finita la conversione dei listati in file separati. Passato anche alla nuova
[gapil.git] / listati / UnSetTermAttr.c
diff --git a/listati/UnSetTermAttr.c b/listati/UnSetTermAttr.c
new file mode 100644 (file)
index 0000000..fbeec75
--- /dev/null
@@ -0,0 +1,17 @@
+int UnSetTermAttr(int fd, tcflag_t flag) 
+{
+    struct termios values;
+    int res;
+    res = tcgetattr (desc, &values);
+    if (res) {
+        perror("Cannot get attributes");
+        return res;
+    }
+    values.c_lflag &= (~flag);
+    res = tcsetattr (desc, TCSANOW, &values);
+    if (res) {
+        perror("Cannot set attributes");
+        return res;
+    }
+    return 0;
+}