version 1.10, 2003/06/03 02:56:18 |
version 1.11, 2006/03/16 19:32:46 |
|
|
#include <errno.h> |
#include <errno.h> |
#include "pathnames.h" |
#include "pathnames.h" |
|
|
/* |
/* |
* uucp style locking routines |
* uucp style locking routines |
* return: 0 - success |
* return: 0 - success |
* -1 - failure |
* -1 - failure |
*/ |
*/ |
|
|
int |
int |
uu_lock(ttyname) |
uu_lock(char *ttyname) |
char *ttyname; |
|
{ |
{ |
int fd, len; |
int fd, len; |
char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN]; |
char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN]; |
|
|
return(-1); |
return(-1); |
} |
} |
len = read(fd, text_pid, sizeof(text_pid)-1); |
len = read(fd, text_pid, sizeof(text_pid)-1); |
if(len<=0) { |
if (len<=0) { |
perror(tbuf); |
perror(tbuf); |
(void)close(fd); |
(void)close(fd); |
fprintf(stderr, "Can't read lock file.\n"); |
fprintf(stderr, "Can't read lock file.\n"); |
|
|
} |
} |
|
|
int |
int |
uu_unlock(ttyname) |
uu_unlock(char *ttyname) |
char *ttyname; |
|
{ |
{ |
char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN]; |
char tbuf[sizeof(_PATH_LOCKDIRNAME) + MAXNAMLEN]; |
|
|