projects
/
gapil.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ancora IPC, code di messaggi SysV
[gapil.git]
/
sources
/
SetTermAttr.c
diff --git
a/sources/SetTermAttr.c
b/sources/SetTermAttr.c
index 96aef88abc86a77c12ef12ce98791bea3f88ddaf..c0e79c3a0affb370bc3a0332c94e77dc5b60dd9a 100644
(file)
--- a/
sources/SetTermAttr.c
+++ b/
sources/SetTermAttr.c
@@
-24,25
+24,24
@@
* Author: Simone Piccardi
* Jun. 2001
*
* Author: Simone Piccardi
* Jun. 2001
*
- * $Id: SetTermAttr.c,v 1.3 2003/05/02 09:55:14 piccardi Exp $
- *
****************************************************************/
****************************************************************/
-#include <unistd.h>
-#include <termios.h>
-#include <errno.h>
+#include <unistd.h> /* unix standard library */
+#include <termios.h> /* terminals constants, types and functions */
+#include <errno.h> /* error definitions and routines */
+#include <stdio.h> /* standard I/O library */
int SetTermAttr(int fd, tcflag_t flag)
{
struct termios values;
int res;
int SetTermAttr(int fd, tcflag_t flag)
{
struct termios values;
int res;
- res = tcgetattr (
desc
, &values);
+ res = tcgetattr (
fd
, &values);
if (res) {
perror("Cannot get attributes");
return res;
}
values.c_lflag |= flag;
if (res) {
perror("Cannot get attributes");
return res;
}
values.c_lflag |= flag;
- res = tcsetattr (
desc
, TCSANOW, &values);
+ res = tcsetattr (
fd
, TCSANOW, &values);
if (res) {
perror("Cannot set attributes");
return res;
if (res) {
perror("Cannot set attributes");
return res;
@@
-54,13
+53,13
@@
int UnSetTermAttr(int fd, tcflag_t flag)
struct termios values;
int res;
struct termios values;
int res;
- res = tcgetattr (
desc
, &values);
+ res = tcgetattr (
fd
, &values);
if (res) {
perror("Cannot get attributes");
return res;
}
values.c_lflag &= (~flag);
if (res) {
perror("Cannot get attributes");
return res;
}
values.c_lflag &= (~flag);
- res = tcsetattr (
desc
, TCSANOW, &values);
+ res = tcsetattr (
fd
, TCSANOW, &values);
if (res) {
perror("Cannot set attributes");
return res;
if (res) {
perror("Cannot set attributes");
return res;