tar returning exit status 2 when called using system()
Whenever I call `tar` using `system()` it fails with an exit status of 2: `WIFEXITED(value)` is true and `WEXITSTATUS(value)` results in 2.

The full command is `/bin/tar -cf /tmp/test.tar /var/log/mylog.log*` which works fine if executed on the command line (using `bash` shell) as root (the program from which I call `system()` is also running as root). "mylog.log" is just a test log setup to log data from my application through `syslog()`.

Any ideas why `tar` might be failing when executed via `system()`, but not on the command line? What does an exit status of 2 indicate?
tar returning exit status 2 when called using system()
===

Whenever I call `tar` using `system()` it fails with an exit status of 2: `WIFEXITED(value)` is true and `WEXITSTATUS(value)` results in 2.

The full command is `/bin/tar -cf /tmp/test.tar /var/log/mylog.log*` which works fine if executed on the command line (using `bash` shell) as root (the program from which I call `system()` is also running as root). "mylog.log" is just a test log setup to log data from my application through `syslog()`.

Any ideas why `tar` might be failing when executed via `system()`, but not on the command line? What does an exit status of 2 indicate?