summaryrefslogtreecommitdiff
path: root/checkpasswd/strerr_die.c
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-06-03 01:38:28 (GMT)
committerJohn Denker <jsd@av8n.com>2012-06-03 01:38:28 (GMT)
commit78488dc84afac1398e582ae6bbaf9606d07afa1e (patch)
tree71723e916f23a6a07422587de275dece3ea60252 /checkpasswd/strerr_die.c
parent81b5f8f3ab26a7969956faef29a90499ece40ff5 (diff)
checkpassword ... as downloaded
Diffstat (limited to 'checkpasswd/strerr_die.c')
-rw-r--r--checkpasswd/strerr_die.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/checkpasswd/strerr_die.c b/checkpasswd/strerr_die.c
new file mode 100644
index 0000000..850028b
--- /dev/null
+++ b/checkpasswd/strerr_die.c
@@ -0,0 +1,31 @@
+#include "buffer.h"
+#include "exit.h"
+#include "strerr.h"
+
+void strerr_warn(char *x1,char *x2,char *x3,char *x4,char *x5,char *x6,struct strerr *se)
+{
+ strerr_sysinit();
+
+ if (x1) buffer_puts(buffer_2,x1);
+ if (x2) buffer_puts(buffer_2,x2);
+ if (x3) buffer_puts(buffer_2,x3);
+ if (x4) buffer_puts(buffer_2,x4);
+ if (x5) buffer_puts(buffer_2,x5);
+ if (x6) buffer_puts(buffer_2,x6);
+
+ while(se) {
+ if (se->x) buffer_puts(buffer_2,se->x);
+ if (se->y) buffer_puts(buffer_2,se->y);
+ if (se->z) buffer_puts(buffer_2,se->z);
+ se = se->who;
+ }
+
+ buffer_puts(buffer_2,"\n");
+ buffer_flush(buffer_2);
+}
+
+void strerr_die(int e,char *x1,char *x2,char *x3,char *x4,char *x5,char *x6,struct strerr *se)
+{
+ strerr_warn(x1,x2,x3,x4,x5,x6,se);
+ _exit(e);
+}