21 |
* |
* |
22 |
*/ |
*/ |
23 |
|
|
24 |
|
#include "config.h" |
25 |
|
|
26 |
#include <sys/types.h> |
#include <sys/types.h> |
27 |
#include <sys/stat.h> |
#include <sys/stat.h> |
28 |
#include <stdlib.h> |
#include <stdlib.h> |
33 |
#include <signal.h> |
#include <signal.h> |
34 |
|
|
35 |
#include "modem/devlock.h" |
#include "modem/devlock.h" |
36 |
|
#include "log.h" |
37 |
|
#include "gettext.h" |
38 |
|
|
39 |
/* note: this function uses the O_EXCL flag to open(), and thus assumes |
/* note: this function uses the O_EXCL flag to open(), and thus assumes |
40 |
that /var/lock is not an NFS-mounted drive (according to the open() man |
that /var/lock is not an NFS-mounted drive (according to the open() man |
83 |
{ |
{ |
84 |
/* we can create a lockfile now */ |
/* we can create a lockfile now */ |
85 |
close (fd); |
close (fd); |
86 |
printf ("Removing stale lock file %s.\n", filename); |
log (LOG_WARNING, gettext ("Removing stale lock file %s.\n"), filename); |
87 |
if (unlink (filename)) |
if (unlink (filename)) |
88 |
{ |
{ |
89 |
perror (filename); |
perror (filename); |