[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnokii/utils mgnokiidev.c,1.21,1.22
From: |
BORBELY Zoltan <address@hidden> |
Subject: |
gnokii/utils mgnokiidev.c,1.21,1.22 |
Date: |
Tue, 14 Oct 2003 21:39:26 +0000 |
Update of /cvsroot/gnokii/gnokii/utils
In directory subversions:/tmp/cvs-serv5164/utils
Modified Files:
mgnokiidev.c
Log Message:
various mgnokiidev bugs fixed
Index: mgnokiidev.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/utils/mgnokiidev.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** mgnokiidev.c 21 Jul 2003 20:41:17 -0000 1.21
--- mgnokiidev.c 14 Oct 2003 21:39:24 -0000 1.22
***************
*** 113,117 ****
if (master >= 0) {
if (!grantpt(master) || !unlockpt(master)) {
! *name = ptsname(master);
} else {
return(-1);
--- 113,117 ----
if (master >= 0) {
if (!grantpt(master) || !unlockpt(master)) {
! *name = strdup(ptsname(master));
} else {
return(-1);
***************
*** 132,147 ****
(*name)[9] = ptyp9[j];
/* open the master pty */
! if ((master = open(*name, O_RDWR | O_NOCTTY |
O_NONBLOCK )) < 0) {
! if (errno == ENOENT) {
! /* we are out of pty devices */
! free(*name);
! return (master);
! }
! }
}
}
if ((master < 0) && (i == 16) && (j == 16)) {
/* must have tried every pty unsuccessfully */
- free(*name);
return (master);
}
--- 132,140 ----
(*name)[9] = ptyp9[j];
/* open the master pty */
! master = open(*name, O_RDWR | O_NOCTTY | O_NONBLOCK );
}
}
if ((master < 0) && (i == 16) && (j == 16)) {
/* must have tried every pty unsuccessfully */
return (master);
}
***************
*** 178,181 ****
--- 171,175 ----
if (PtyRDFD < 0 || name == NULL) {
fprintf (stderr, _("Couldn't open pty!\n"));
+ perror("mgnokiidev - GetMasterPty");
goto error;
}
***************
*** 188,192 ****
/* Change group of slave pty to group of mgnokiidev */
if (chown(name, -1, getgid()) < 0) {
! perror("mgnokiidev - chown: ");
goto error;
}
--- 182,186 ----
/* Change group of slave pty to group of mgnokiidev */
if (chown(name, -1, getgid()) < 0) {
! perror("mgnokiidev - chown");
goto error;
}
***************
*** 194,198 ****
/* Change permissions to rw by group */
if (chmod(name, S_IRGRP | S_IWGRP | S_IRUSR | S_IWUSR) < 0) {
! perror("mgnokiidev - chmod: ");
goto error;
}
--- 188,192 ----
/* Change permissions to rw by group */
if (chmod(name, S_IRGRP | S_IWGRP | S_IRUSR | S_IWUSR) < 0) {
! perror("mgnokiidev - chmod");
goto error;
}
***************
*** 209,213 ****
/* Create symlink */
if (symlink(name, "/dev/gnokii") < 0) {
! perror("mgnokiidev - symlink: ");
goto error;
}
--- 203,207 ----
/* Create symlink */
if (symlink(name, "/dev/gnokii") < 0) {
! perror("mgnokiidev - symlink");
goto error;
}
***************
*** 215,218 ****
--- 209,213 ----
/* Now pass the descriptor to the caller */
if ((n = gwrite(atoi(argv[1]), "", 1, PtyRDFD)) < 0) {
+ perror("mgnokiidev - gwrite");
goto error;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnokii/utils mgnokiidev.c,1.21,1.22,
BORBELY Zoltan <address@hidden> <=