/mandos/release

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

« back to all changes in this revision

Viewing changes to plugins.d/plymouth.c

* plugins.d/mandos-client.c (avahi_loop_with_timeout): Fix warning.
  (main): Disallow "--retry" arguments < 0.  Allow brackets [] around
          IPv6 addresses, as recommended by RFC 5952.  Bug fix: When
          using --connect, really use retry_interval, not 1 second.
* plugins.d/mandos-client.xml (DESCRIPTION): Add retry info.
  (--retry): Remove repeated word.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <stddef.h>             /* NULL */
37
37
#include <string.h>             /* strchr(), memcmp() */
38
38
#include <stdio.h>              /* asprintf(), perror(), fopen(),
39
 
                                   fscanf(), vasprintf(), fprintf(), vfprintf() */
 
39
                                   fscanf(), vasprintf(), fprintf(),
 
40
                                   vfprintf() */
40
41
#include <unistd.h>             /* close(), readlink(), read(),
41
42
                                   fork(), setsid(), chdir(), dup2(),
42
43
                                   STDERR_FILENO, execv(), access() */
72
73
}
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));
279
282
      }
280
283
    }
281
284
    /* scandir might preallocate for this variable (man page unclear).
282
 
       even if ret == 0, we need to free it. */
 
285
       even if ret == 0, therefore we need to free it. */
283
286
    free(direntries);
284
287
  }
285
288
  pid_t pid;