Back to index

courier  0.68.2
Functions
loginexec.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void maildir_loginexec (void)

Function Documentation

void maildir_loginexec ( void  )

Definition at line 18 of file loginexec.c.

{
#ifdef LOGINEXEC_FILE
struct stat buf;
pid_t pid;
int waitstat;

       if (stat(LOGINEXEC_FILE, &buf) != 0 || (buf.st_mode & S_IXUSR) == 0)
              return;

       while ((pid=fork()) == -1)
       {
              sleep(5);
       }
       if (pid == 0)
       {
              execl("./" LOGINEXEC_FILE, LOGINEXEC_FILE, (char *)0);
              perror("Failed to exec " LOGINEXEC_FILE);
              exit(1);
       }
       while (wait(&waitstat) != pid)
              ;
       if (WIFEXITED(waitstat) && WEXITSTATUS(waitstat) == 0)
              unlink(LOGINEXEC_FILE);
#endif
}

Here is the caller graph for this function: