Lines 53-61
static int state_lock_(const char *file, int lock, int timeout)
Link Here
|
53 |
lck.l_len = 11; |
53 |
lck.l_len = 11; |
54 |
lck.l_pid = 0; |
54 |
lck.l_pid = 0; |
55 |
if (lock) { |
55 |
if (lock) { |
56 |
sprintf(lcktxt, "%10li\n", (long)getpid()); |
56 |
snprintf(lcktxt, sizeof(lcktxt), "%10li\n", (long)getpid()); |
57 |
} else { |
57 |
} else { |
58 |
sprintf(lcktxt, "%10s\n", ""); |
58 |
snprintf(lcktxt, sizeof(lcktxt), "%10s\n", ""); |
59 |
} |
59 |
} |
60 |
while (fd < 0 && timeout-- > 0) { |
60 |
while (fd < 0 && timeout-- > 0) { |
61 |
fd = open(nfile, O_RDWR); |
61 |
fd = open(nfile, O_RDWR); |
62 |
- |
|
|