summaryrefslogtreecommitdiff
path: root/lib/openat-proc.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2009-12-10 20:28:30 +0100
committerBruno Haible <bruno@clisp.org>2009-12-10 20:28:30 +0100
commit441aa3044f43e5572f58c354f01e6bc070acd5c7 (patch)
treebef236e8058dd3469da28ffcd5a6a287222a4c50 /lib/openat-proc.c
parent039ae97b8ae35a2446c5d62d72b21689c97da7e2 (diff)
downloadgnulib-441aa3044f43e5572f58c354f01e6bc070acd5c7.tar.gz
Use spaces for indentation, not tabs.
Diffstat (limited to 'lib/openat-proc.c')
-rw-r--r--lib/openat-proc.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/openat-proc.c b/lib/openat-proc.c
index 76e1c6dd51..483201ce59 100644
--- a/lib/openat-proc.c
+++ b/lib/openat-proc.c
@@ -67,29 +67,29 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
if (! proc_status)
{
/* Set PROC_STATUS to a positive value if /proc/self/fd is
- reliable, and a negative value otherwise. Solaris 10
- /proc/self/fd mishandles "..", and any file name might expand
- to ".." after symbolic link expansion, so avoid /proc/self/fd
- if it mishandles "..". Solaris 10 has openat, but this
- problem is exhibited on code that built on Solaris 8 and
- running on Solaris 10. */
+ reliable, and a negative value otherwise. Solaris 10
+ /proc/self/fd mishandles "..", and any file name might expand
+ to ".." after symbolic link expansion, so avoid /proc/self/fd
+ if it mishandles "..". Solaris 10 has openat, but this
+ problem is exhibited on code that built on Solaris 8 and
+ running on Solaris 10. */
int proc_self_fd = open ("/proc/self/fd", O_RDONLY);
if (proc_self_fd < 0)
- proc_status = -1;
+ proc_status = -1;
else
- {
- struct stat proc_self_fd_dotdot_st;
- struct stat proc_self_st;
- char dotdot_buf[PROC_SELF_FD_NAME_SIZE_BOUND (sizeof ".." - 1)];
- sprintf (dotdot_buf, PROC_SELF_FD_FORMAT, proc_self_fd, "..");
- proc_status =
- ((stat (dotdot_buf, &proc_self_fd_dotdot_st) == 0
- && stat ("/proc/self", &proc_self_st) == 0
- && SAME_INODE (proc_self_fd_dotdot_st, proc_self_st))
- ? 1 : -1);
- close (proc_self_fd);
- }
+ {
+ struct stat proc_self_fd_dotdot_st;
+ struct stat proc_self_st;
+ char dotdot_buf[PROC_SELF_FD_NAME_SIZE_BOUND (sizeof ".." - 1)];
+ sprintf (dotdot_buf, PROC_SELF_FD_FORMAT, proc_self_fd, "..");
+ proc_status =
+ ((stat (dotdot_buf, &proc_self_fd_dotdot_st) == 0
+ && stat ("/proc/self", &proc_self_st) == 0
+ && SAME_INODE (proc_self_fd_dotdot_st, proc_self_st))
+ ? 1 : -1);
+ close (proc_self_fd);
+ }
}
if (proc_status < 0)