--- embedtools/src/cfexec.c 2012/07/22 22:46:47 1.3 +++ embedtools/src/cfexec.c 2013/08/05 12:38:36 1.4.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: cfexec.c,v 1.3 2012/07/22 22:46:47 misho Exp $ + * $Id: cfexec.c,v 1.4.2.2 2013/08/05 12:38:36 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -64,7 +64,7 @@ Usage() "\t-c \tAfter execute chroot to dir [default=/]\n" "\t-u \tAfter execute suid to user [default=root]\n" "\t-d \tOther device [default=/dev/ufs/elwix]\n" - "\t-m \tOther mount dir [default=/cf]\n" + "\t-m \tOther mount dir [default=/]\n" "\t-t \tTimeout for autolock mount dir after seconds [default=300]\n" "\n", compiled, compiledby, compilehost); } @@ -111,15 +111,15 @@ static int mkevent(struct kevent *chg, struct kevent *evt) { int f; - char szStr[MAX_STR]; + char szStr[STRSIZ]; f = open(szSess, O_CREAT | O_WRONLY | O_TRUNC, 0644); if (f == -1) { printf("Error:: can`t lock session #%d - %s\n", errno, strerror(errno)); return -1; } else { - memset(szStr, 0, MAX_STR); - snprintf(szStr, MAX_STR, "%d", getpid()); + memset(szStr, 0, sizeof szStr); + snprintf(szStr, sizeof szStr, "%d", getpid()); write(f, szStr, strlen(szStr)); } VERB(3) printf("Created lock file %s\n", szSess); @@ -135,7 +135,7 @@ mkevent(struct kevent *chg, struct kevent *evt) memset(evt, 0, sizeof(struct kevent)); EV_SET(chg, f, EVFILT_VNODE, EV_ADD, NOTE_DELETE | NOTE_RENAME | NOTE_REVOKE, - 0, (intptr_t) NULL); + 0, NULL); } return f;