/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/splashy.c

  • Committer: Teddy Hogeborn
  • Date: 2009-10-18 08:47:40 UTC
  • Revision ID: teddy@fukt.bsnet.se-20091018084740-fa1qgm22lg125r10
* plugins.d/splashy.c: Use exit codes from <sysexits.h>.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
                                   STDOUT_FILENO, _exit(),
44
44
                                   pause() */
45
45
#include <string.h>             /* memcmp() */
46
 
#include <errno.h>              /* errno, EACCES, ENOTDIR, ELOOP,
47
 
                                   ENOENT, ENAMETOOLONG, EMFILE,
48
 
                                   ENFILE, ENOMEM, ENOEXEC, EINVAL,
49
 
                                   E2BIG, EFAULT, EIO, ETXTBSY,
50
 
                                   EISDIR, ELIBBAD, EPERM, EINTR,
51
 
                                   ECHILD */
 
46
#include <errno.h>              /* errno */
52
47
#include <sys/wait.h>           /* waitpid(), WIFEXITED(),
53
48
                                   WEXITSTATUS() */
 
49
 
54
50
#include <sysexits.h>           /* EX_OSERR, EX_OSFILE,
55
51
                                   EX_UNAVAILABLE */
56
52
 
292
288
    if(not interrupted_by_signal){
293
289
      const char splashy_command[] = "/sbin/splashy_update";
294
290
      execl(splashy_command, splashy_command, prompt, (char *)NULL);
295
 
      int e = errno;
296
291
      perror("execl");
297
 
      switch(e){
298
 
      case EACCES:
299
 
      case ENOENT:
300
 
      case ENOEXEC:
301
 
      case EINVAL:
302
 
        _exit(EX_UNAVAILABLE);
303
 
      case ENAMETOOLONG:
304
 
      case E2BIG:
305
 
      case ENOMEM:
306
 
      case EFAULT:
307
 
      case EIO:
308
 
      case EMFILE:
309
 
      case ENFILE:
310
 
      case ETXTBSY:
311
 
      default:
312
 
        _exit(EX_OSERR);
313
 
      case ENOTDIR:
314
 
      case ELOOP:
315
 
      case EISDIR:
316
 
      case ELIBBAD:
317
 
      case EPERM:
318
 
        _exit(EX_OSFILE);
319
 
      }
320
292
    }
321
293
    free(prompt);
322
294
    _exit(EXIT_FAILURE);