i have 2 executable files. From one of them i'm calling the other one. it is also executed correctly, but does not return 0.
why?
backup.c file :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <mysql/mysql.h>
int main(int argc, char * argv[])
{
if(!execl("/home/user1/exec_work/binary","/home/user1/exec_work/binary","serdar","ilter",NULL))
{
/* This line is not printed to the screen. */
printf("0\n");
}
else
{
/* This line is not printed to the screen either. */
printf("1\n");
}
return 1;
}
The other source file:
#include <stdio.h>
int main(int argc, char * argv[])
{
/* I see that this line is printed to the screen */
printf("%s %s\n",argv[1],argv[2]);
return 0;
}