Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Update.
* stdlib/Makefile: Add rules to build and run tst-putenv. * stdlib/tst-putenv.c: New file. * stdlib/tst-putenvmod.c: New file.
- Loading branch information
Ulrich Drepper
committed
Jan 4, 2005
1 parent
3fb2606
commit 574b268
Showing
4 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
static int | ||
do_test (void) | ||
{ | ||
char *p = getenv ("SOMETHING_NOBODY_USES"); | ||
if (p == NULL) | ||
{ | ||
puts ("envvar not defined"); | ||
return 1; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
#define TEST_FUNCTION do_test () | ||
#include "../test-skeleton.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
void | ||
__attribute ((constructor)) | ||
init (void) | ||
{ | ||
puts ("init DSO"); | ||
|
||
static char str[] = "SOMETHING_NOBODY_USES=something_else"; | ||
if (putenv (str) != 0) | ||
{ | ||
puts ("putenv failed"); | ||
_exit (1); | ||
} | ||
} |