version 1.5.20.3, 2017/10/08 22:28:26
|
version 1.5.20.5, 2017/10/08 22:34:41
|
Line 160 static int
|
Line 160 static int
|
s_unlck() |
s_unlck() |
{ |
{ |
if (access(szSLCK, F_OK)) |
if (access(szSLCK, F_OK)) |
return 1; | return 2; |
|
|
if (access(szSess, F_OK) && update(MNT_UPDATE | MNT_RDONLY) == -1) |
if (access(szSess, F_OK) && update(MNT_UPDATE | MNT_RDONLY) == -1) |
return 8; |
return 8; |
Line 177 s_lck(const char *reason)
|
Line 177 s_lck(const char *reason)
|
char szStr[STRSIZ]; |
char szStr[STRSIZ]; |
|
|
if (!access(szSLCK, F_OK)) { |
if (!access(szSLCK, F_OK)) { |
printf("cfexec:: Service held lock ...\n"); | printf("cfexec already held service lock ...\n"); |
return 127; |
return 127; |
} |
} |
|
|
f = open(szSLCK, O_CREAT | O_WRONLY | O_TRUNC, 0644); |
f = open(szSLCK, O_CREAT | O_WRONLY | O_TRUNC, 0644); |
if (f == -1) { |
if (f == -1) { |
printf("Error:: can`t service lock session #%d - %s\n", errno, strerror(errno)); |
printf("Error:: can`t service lock session #%d - %s\n", errno, strerror(errno)); |
return 5; | return 4; |
} else { |
} else { |
memset(szStr, 0, sizeof szStr); |
memset(szStr, 0, sizeof szStr); |
snprintf(szStr, sizeof szStr, "[%d] - %s", getpid(), reason); |
snprintf(szStr, sizeof szStr, "[%d] - %s", getpid(), reason); |
Line 194 s_lck(const char *reason)
|
Line 194 s_lck(const char *reason)
|
|
|
if (update(MNT_UPDATE) == -1) { |
if (update(MNT_UPDATE) == -1) { |
unlink(szSLCK); |
unlink(szSLCK); |
return 4; | return 5; |
} |
} |
|
|
VERB(3) printf("Lock & created service lock file %s\n", szSLCK); |
VERB(3) printf("Lock & created service lock file %s\n", szSLCK); |