From 3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f Mon Sep 17 00:00:00 2001 From: deischen Date: Sun, 11 Feb 2001 22:07:32 +0000 Subject: Remove (int) file descriptor locking. It should be up to the application to provide locking for I/O operations. This doesn't break any of my tests, but the old behavior can be restored by compiling with _FDLOCKS_ENABLED. This will eventually be removed when it is obvious it does not cause any problems. Remove most of flockfile implementation, with the exception of flockfile_debug. Make error messages more informational (submitted by Mike Heffner , who's now known as mikeh@FreeBSD.org). --- lib/libpthread/thread/thr_exit.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'lib/libpthread/thread/thr_exit.c') diff --git a/lib/libpthread/thread/thr_exit.c b/lib/libpthread/thread/thr_exit.c index 169aa4f..fd0e84a 100644 --- a/lib/libpthread/thread/thr_exit.c +++ b/lib/libpthread/thread/thr_exit.c @@ -87,13 +87,9 @@ _thread_exit(char *fname, int lineno, char *string) char s[256]; /* Prepare an error message string: */ - strcpy(s, "Fatal error '"); - strcat(s, string); - strcat(s, "' at line ? "); - strcat(s, "in file "); - strcat(s, fname); - strcat(s, " (errno = ?"); - strcat(s, ")\n"); + snprintf(s, sizeof(s), + "Fatal error '%s' at line %d in file %s (errno = %d)\n", + string, lineno, fname, errno); /* Write the string to the standard error file descriptor: */ __sys_write(2, s, strlen(s)); @@ -127,9 +123,6 @@ _thread_exit_cleanup(void) /* Unlock all owned fd locks: */ _thread_fd_unlock_owned(curthread); - /* Unlock all owned file locks: */ - _funlock_owned(curthread); - /* Unlock all private mutexes: */ _mutex_unlock_private(curthread); -- cgit v1.1