]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
test: Try setting and getting an environment variable after setproctitle()
authorGuillem Jover <guillem@hadrons.org>
Sat, 8 Jun 2013 06:15:21 +0000 (08:15 +0200)
committerGuillem Jover <guillem@hadrons.org>
Sat, 8 Jun 2013 16:08:58 +0000 (18:08 +0200)
COPYING
test/proctitle.c

diff --git a/COPYING b/COPYING
index 5bcfd389abec8d1e4be04ae0f485f4b1c09ee0d2..285ed8f9803ede0f568d1d9bd7d1d7d0dea2758f 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -66,7 +66,7 @@ for man/arc4random.3, man/tree.3 and man/getprogname.3.
 The rest of the licenses apply to code and/or man pages.
 
 
-    Copyright © 2004-2006, 2008-2012 Guillem Jover <guillem@hadrons.org>
+    Copyright © 2004-2006, 2008-2013 Guillem Jover <guillem@hadrons.org>
     Copyright © 2005 Hector Garcia Alvarez
     Copyright © 2005 Aurelien Jarno
     Copyright © 2006 Robert Millan
index 450f0d19f8a6599ac2eecd54dd577293f770811a..56ea863981d8d2a1a658ad12d3731d169a931f36 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2012 Guillem Jover <guillem@hadrons.org>
+ * Copyright © 2012-2013 Guillem Jover <guillem@hadrons.org>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -35,6 +35,7 @@ main(int argc, char **argv)
 {
        const char newtitle_base[] = "test arg1 arg2";
        char *newtitle_full;
+       char *envvar;
 
        setproctitle("-test %s arg2", "arg1");
        assert(strcmp(argv[0], newtitle_base) == 0);
@@ -44,5 +45,10 @@ main(int argc, char **argv)
        assert(strcmp(argv[0], newtitle_full) == 0);
        free(newtitle_full);
 
+       assert(setenv("LIBBSD_TEST", "test value", 1) == 0);
+       envvar = getenv("LIBBSD_TEST");
+       assert(envvar != NULL);
+       assert(strcmp(envvar, "test value") == 0);
+
        return 0;
 }