tests/example.c: Use errno = ENOMEM.

The output from errno = 0 is less portable.
This commit is contained in:
Simon Ruderich
2013-06-17 23:28:07 +02:00
parent a63fef43c2
commit 85699d0263
3 changed files with 3 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ int main(int argc, char **argv unused) {
printf("write to stdout\n");
fflush(stdout);
errno = 0;
errno = ENOMEM;
perror("error!");
write(STDERR_FILENO, "write to stderr 2", 17);

View File

@@ -1,6 +1,6 @@
>STDERR>write to stderr: 1
<STDERR<write to stdout
>STDERR>error!: Success
>STDERR>error!: Cannot allocate memory
<STDERR<>STDERR>write to stderr 2<STDERR<write to stdout 2>STDERR>
<STDERR<
>STDERR>more on stderr

View File

@@ -1,6 +1,6 @@
write to stderr: 1
write to stdout
error!: Success
error!: Cannot allocate memory
write to stderr 2write to stdout 2
more on stderr