summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_exit.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2001-02-11 22:07:32 +0000
committerdeischen <deischen@FreeBSD.org>2001-02-11 22:07:32 +0000
commit3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f (patch)
tree5a22dcd523f742073beada495d06ed1dc2fce5e9 /lib/libpthread/thread/thr_exit.c
parent1143b5e42a7816a7665798bcab7d5db4a37935b3 (diff)
downloadFreeBSD-src-3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f.zip
FreeBSD-src-3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f.tar.gz
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 <spock@techfour.net>, who's now known as mikeh@FreeBSD.org).
Diffstat (limited to 'lib/libpthread/thread/thr_exit.c')
-rw-r--r--lib/libpthread/thread/thr_exit.c13
1 files changed, 3 insertions, 10 deletions
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);
OpenPOWER on IntegriCloud