/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/usplash.c

  • Committer: Björn Påhlsson
  • Date: 2011-07-25 18:46:19 UTC
  • mfrom: (487 trunk)
  • mto: This revision was merged to the branch mainline in revision 489.
  • Revision ID: belorn@fukt.bsnet.se-20110725184619-l7vfsobr0bh9fc3l
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
                                   dirent */
37
37
#include <stddef.h>             /* NULL */
38
38
#include <string.h>             /* strlen(), memcmp(), strerror() */
39
 
#include <stdio.h>              /* asprintf(), vasprintf(), vprintf(), fprintf() */
 
39
#include <stdio.h>              /* asprintf(), vasprintf(), vprintf(),
 
40
                                   fprintf() */
40
41
#include <unistd.h>             /* close(), write(), readlink(),
41
42
                                   read(), STDOUT_FILENO, sleep(),
42
43
                                   fork(), setuid(), geteuid(),
57
58
const char usplash_name[] = "/sbin/usplash";
58
59
 
59
60
/* Function to use when printing errors */
60
 
void error_plus(int status, int errnum, const char *formatstring, ...){
 
61
void error_plus(int status, int errnum, const char *formatstring,
 
62
                ...){
61
63
  va_list ap;
62
64
  char *text;
63
65
  int ret;
65
67
  va_start(ap, formatstring);
66
68
  ret = vasprintf(&text, formatstring, ap);
67
69
  if (ret == -1){
68
 
    fprintf(stderr, "Mandos plugin %s: ", program_invocation_short_name);
 
70
    fprintf(stderr, "Mandos plugin %s: ",
 
71
            program_invocation_short_name);
69
72
    vfprintf(stderr, formatstring, ap);
70
73
    fprintf(stderr, ": ");
71
74
    fprintf(stderr, "%s\n", strerror(errnum));