|
version 1.2.2.3, 2012/04/05 12:22:44
|
version 1.4.2.3, 2014/01/30 01:03:21
|
|
Line 12 terms:
|
Line 12 terms:
|
| All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
| Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
| |
|
| Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 | Copyright 2004 - 2014 |
| by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
| |
|
| Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
|
Line 64 Usage()
|
Line 64 Usage()
|
| "\t-c <dir>\tAfter execute chroot to dir [default=/]\n" |
"\t-c <dir>\tAfter execute chroot to dir [default=/]\n" |
| "\t-u <user>\tAfter execute suid to user [default=root]\n" |
"\t-u <user>\tAfter execute suid to user [default=root]\n" |
| "\t-d <dev>\tOther device [default=/dev/ufs/elwix]\n" |
"\t-d <dev>\tOther device [default=/dev/ufs/elwix]\n" |
| "\t-m <mnt>\tOther mount dir [default=/cf]\n" | "\t-m <mnt>\tOther mount dir [default=/]\n" |
| "\t-t <sec>\tTimeout for autolock mount dir after seconds [default=300]\n" |
"\t-t <sec>\tTimeout for autolock mount dir after seconds [default=300]\n" |
| "\n", compiled, compiledby, compilehost); |
"\n", compiled, compiledby, compilehost); |
| } |
} |
|
Line 111 static int
|
Line 111 static int
|
| mkevent(struct kevent *chg, struct kevent *evt) |
mkevent(struct kevent *chg, struct kevent *evt) |
| { |
{ |
| int f; |
int f; |
| char szStr[MAX_STR]; | char szStr[STRSIZ]; |
| |
|
| f = open(szSess, O_CREAT | O_WRONLY | O_TRUNC, 0644); |
f = open(szSess, O_CREAT | O_WRONLY | O_TRUNC, 0644); |
| if (f == -1) { |
if (f == -1) { |
| printf("Error:: can`t lock session #%d - %s\n", errno, strerror(errno)); |
printf("Error:: can`t lock session #%d - %s\n", errno, strerror(errno)); |
| return -1; |
return -1; |
| } else { |
} else { |
| memset(szStr, 0, MAX_STR); | memset(szStr, 0, sizeof szStr); |
| snprintf(szStr, MAX_STR, "%d", getpid()); | snprintf(szStr, sizeof szStr, "%d", getpid()); |
| write(f, szStr, strlen(szStr)); |
write(f, szStr, strlen(szStr)); |
| } |
} |
| VERB(3) printf("Created lock file %s\n", szSess); |
VERB(3) printf("Created lock file %s\n", szSess); |
|
Line 135 mkevent(struct kevent *chg, struct kevent *evt)
|
Line 135 mkevent(struct kevent *chg, struct kevent *evt)
|
| memset(evt, 0, sizeof(struct kevent)); |
memset(evt, 0, sizeof(struct kevent)); |
| |
|
| EV_SET(chg, f, EVFILT_VNODE, EV_ADD, NOTE_DELETE | NOTE_RENAME | NOTE_REVOKE, |
EV_SET(chg, f, EVFILT_VNODE, EV_ADD, NOTE_DELETE | NOTE_RENAME | NOTE_REVOKE, |
| 0, (intptr_t) NULL); | 0, NULL); |
| } |
} |
| |
|
| return f; |
return f; |