LINUX.ORG.RU

История изменений

Исправление Pinkbyte, (текущая версия) :

Значение, возвращаемое system, отследить не могу, т.к. проект является демоном.

Ээээ, а посмотреть чему равен код возврата system(а он есть!) через syslog - религия не позволяет?

Цитата из man system:

RETURN VALUE
       The return value of system() is one of the following:

       *  If command is NULL, then a nonzero value if a shell is available, or 0 if no shell is available.

       *  If a child process could not be created, or its status could not be retrieved, the return value is -1.

       *  If  a  shell  could not be executed in the child process, then the return value is as though the child shell terminated by calling _exit(2) with
          the status 127.

       *  If all system calls succeed, then the return value is the termination status of the child shell used to execute command.  (The termination  sta-
          tus of a shell is the termination status of the last command it executes.)

       In the last two cases, the return value is a "wait status" that can be examined using the macros described in waitpid(2).  (i.e., WIFEXITED(), WEX-
       ITSTATUS(), and so on).

       system() does not affect the wait status of any other children.

Для работы с syslog кури man openlog, например

Исходная версия Pinkbyte, :

Ээээ, а посмотреть чему равен код возврата system(а он есть!) - религия не позволяет?

Цитата из man system:

RETURN VALUE
       The return value of system() is one of the following:

       *  If command is NULL, then a nonzero value if a shell is available, or 0 if no shell is available.

       *  If a child process could not be created, or its status could not be retrieved, the return value is -1.

       *  If  a  shell  could not be executed in the child process, then the return value is as though the child shell terminated by calling _exit(2) with
          the status 127.

       *  If all system calls succeed, then the return value is the termination status of the child shell used to execute command.  (The termination  sta-
          tus of a shell is the termination status of the last command it executes.)

       In the last two cases, the return value is a "wait status" that can be examined using the macros described in waitpid(2).  (i.e., WIFEXITED(), WEX-
       ITSTATUS(), and so on).

       system() does not affect the wait status of any other children.