From 802ca5a5efa5d11836b2ffd81c9f6fd42f938ac6 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 10 May 2012 13:00:01 -0700 Subject: Hurd: Missing critical region locks. --- sysdeps/mach/hurd/dirfd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sysdeps/mach/hurd/dirfd.c') diff --git a/sysdeps/mach/hurd/dirfd.c b/sysdeps/mach/hurd/dirfd.c index 587ae7b2f1..42dbc78839 100644 --- a/sysdeps/mach/hurd/dirfd.c +++ b/sysdeps/mach/hurd/dirfd.c @@ -1,5 +1,5 @@ /* dirfd -- Return the file descriptor used by a DIR stream. Hurd version. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,6 +25,8 @@ int dirfd (DIR *dirp) { int fd; + + HURD_CRITICAL_BEGIN; __mutex_lock (&_hurd_dtable_lock); for (fd = 0; fd < _hurd_dtablesize; ++fd) if (_hurd_dtable[fd] == dirp->__fd) @@ -35,6 +37,7 @@ dirfd (DIR *dirp) fd = -1; } __mutex_unlock (&_hurd_dtable_lock); + HURD_CRITICAL_END; return fd; } -- cgit 1.4.1