projects
/
debian
/
tar
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'dfsg-orig' into dfsg-debian
[debian/tar]
/
lib
/
dirfd.c
diff --git
a/lib/dirfd.c
b/lib/dirfd.c
index 3458e99b203bc9764b745e71dd3e3dc9a9e845e5..81993c502c1f89c71304d7390c9df8240a86d782 100644
(file)
--- a/
lib/dirfd.c
+++ b/
lib/dirfd.c
@@
-1,6
+1,6
@@
/* dirfd.c -- return the file descriptor associated with an open DIR*
/* dirfd.c -- return the file descriptor associated with an open DIR*
- Copyright (C) 2001, 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2006, 2008
-2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-20,9
+20,13
@@
#include <config.h>
#include <dirent.h>
#include <config.h>
#include <dirent.h>
+#include <errno.h>
int
dirfd (DIR const *dir_p)
{
int
dirfd (DIR const *dir_p)
{
- return DIR_TO_FD (dir_p);
+ int fd = DIR_TO_FD (dir_p);
+ if (fd == -1)
+ errno = ENOTSUP;
+ return fd;
}
}