version 1.1.1.1.2.2, 2009/11/12 11:45:34
|
version 1.1.1.1.2.3, 2009/11/12 11:51:50
|
Line 110 int main(int argc, char **argv)
|
Line 110 int main(int argc, char **argv)
|
// Load variables from config if exists |
// Load variables from config if exists |
if (!LoadConfig(szConfig, &cfg)) { |
if (!LoadConfig(szConfig, &cfg)) { |
cfg_LoadAttribute(&cfg, CFG("cfexec"), CFG("timeout"), CFG(szUser), MAX_STR, DEFAULT_TIMEOUT); |
cfg_LoadAttribute(&cfg, CFG("cfexec"), CFG("timeout"), CFG(szUser), MAX_STR, DEFAULT_TIMEOUT); |
Timeout = strtonum(szUser, 1, 3600, &err); | Timeout = strtonum(szUser, 0, 3600, &err); |
if (!Timeout) { | if (!Timeout && err) { |
printf("Error:: in seconds for timeout %s - %s\n", optarg, err); |
printf("Error:: in seconds for timeout %s - %s\n", optarg, err); |
UnloadConfig(&cfg); |
UnloadConfig(&cfg); |
return 1; |
return 1; |
Line 149 int main(int argc, char **argv)
|
Line 149 int main(int argc, char **argv)
|
strlcpy(szMount, optarg, MAXPATHLEN); |
strlcpy(szMount, optarg, MAXPATHLEN); |
break; |
break; |
case 't': |
case 't': |
Timeout = strtonum(optarg, 1, 3600, &err); | Timeout = strtonum(optarg, 0, 3600, &err); |
if (!Timeout) { | if (!Timeout && err) { |
printf("Error:: in seconds for timeout %s - %s\n", |
printf("Error:: in seconds for timeout %s - %s\n", |
optarg, err); |
optarg, err); |
return 1; |
return 1; |
Line 191 int main(int argc, char **argv)
|
Line 191 int main(int argc, char **argv)
|
if ((f = mkevent(&chg, &evt)) == -1) |
if ((f = mkevent(&chg, &evt)) == -1) |
return 5; |
return 5; |
|
|
memset(&ts, 0, sizeof ts); | if (Timeout) { |
ts.tv_sec = Timeout; | memset(&ts, 0, sizeof ts); |
| ts.tv_sec = Timeout; |
| } |
switch (kevent(kq, &chg, 1, &evt, 1, !Timeout ? NULL : &ts)) { |
switch (kevent(kq, &chg, 1, &evt, 1, !Timeout ? NULL : &ts)) { |
case -1: |
case -1: |
printf("Error:: can`t execute safe mount #%d - %s\n", |
printf("Error:: can`t execute safe mount #%d - %s\n", |