/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/password-prompt.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:
41
41
                                   getenv(), free() */
42
42
#include <dirent.h>             /* scandir(), alphasort() */
43
43
#include <stdio.h>              /* fprintf(), stderr, getline(),
44
 
                                   stdin, feof(), fputc(), vfprintf(), vasprintf()
45
 
                                */
 
44
                                   stdin, feof(), fputc(), vfprintf(),
 
45
                                   vasprintf() */
46
46
#include <errno.h>              /* errno, EBADF, ENOTTY, EINVAL,
47
47
                                   EFAULT, EFBIG, EIO, ENOSPC, EINTR
48
48
                                */
51
51
#include <stdbool.h>            /* bool, false, true */
52
52
#include <inttypes.h>           /* strtoumax() */
53
53
#include <sys/stat.h>           /* struct stat, lstat(), open() */
54
 
#include <string.h>             /* strlen, rindex, memcmp, strerror() */
 
54
#include <string.h>             /* strlen, rindex, memcmp, strerror()
 
55
                                 */
55
56
#include <argp.h>               /* struct argp_option, struct
56
57
                                   argp_state, struct argp,
57
58
                                   argp_parse(), error_t,
72
73
const char plymouth_name[] = "plymouthd";
73
74
 
74
75
/* Function to use when printing errors */
75
 
void error_plus(int status, int errnum, const char *formatstring, ...){
 
76
void error_plus(int status, int errnum, const char *formatstring,
 
77
                ...){
76
78
  va_list ap;
77
79
  char *text;
78
80
  int ret;
80
82
  va_start(ap, formatstring);
81
83
  ret = vasprintf(&text, formatstring, ap);
82
84
  if (ret == -1){
83
 
    fprintf(stderr, "Mandos plugin %s: ", program_invocation_short_name);
 
85
    fprintf(stderr, "Mandos plugin %s: ",
 
86
            program_invocation_short_name);
84
87
    vfprintf(stderr, formatstring, ap);
85
88
    fprintf(stderr, ": ");
86
89
    fprintf(stderr, "%s\n", strerror(errnum));