Changeset 140 for trunk/src/sh_error.c
- Timestamp:
- Oct 29, 2007, 1:09:10 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_error.c
r133 r140 56 56 #include "sh_forward.h" 57 57 #include "sh_prelude.h" 58 #include "sh_pthread.h" 58 59 59 60 #if defined(WITH_DATABASE) … … 857 858 **********************************************************/ 858 859 860 SH_MUTEX_RECURSIVE(mutex_err_handle); 861 859 862 void sh_error_handle (int sev, char * file, long line, 860 863 long status, unsigned long msg_id, ...) … … 868 871 869 872 int flag_inet = S_FALSE; 873 874 #ifdef SH_WITH_SERVER 870 875 int class_inet = clt_class; /* initialize from global */ 871 872 #ifdef SH_WITH_SERVER873 876 char local_inet_peer[SH_MINIBUF]; 874 877 #endif … … 908 911 SL_ENTER(_("sh_error_handle")); 909 912 913 SH_MUTEX_RECURSIVE_INIT(mutex_err_handle); 914 SH_MUTEX_RECURSIVE_LOCK(mutex_err_handle); 915 910 916 #ifdef SH_WITH_SERVER 911 917 /* copy the global string into a local array … … 918 924 else 919 925 local_inet_peer[0] = '\0'; 920 #endif921 926 922 927 clt_class = (-1); /* reset global */ 928 #endif 929 923 930 924 931 if (own_block == 1) 925 932 { 926 SL_RET0(_("sh_error_handle"));933 goto exit_here; 927 934 } 928 935 929 936 /* --- Initialize to default values. --- 930 937 */ 931 own_block = 1;932 938 if (IsInitialized == BAD) 933 939 (void) sh_error_init(); 934 own_block = 0; 935 936 /* --- Consistency checks. --- 937 */ 938 own_block = 1; 940 941 /* Returns pointer to (constant|thread-specific) static memory 942 */ 939 943 fmt = /*@i@*/get_format (msg_id, &severity, &class); 940 own_block = 0; 941 944 945 #ifdef SH_WITH_SERVER 942 946 if (class_inet != (-1)) 943 947 class = (unsigned int) class_inet; 944 948 #endif 949 950 /* --- Consistency check. --- 951 */ 945 952 ASSERT((fmt != NULL), _("fmt != NULL")) 946 953 if (fmt == NULL) … … 949 956 _("ERROR: msg=<NULL format>, file=<%s>, line=<%ld>\n"), 950 957 file, line); 951 SL_RET0(_("sh_error_handle"));958 goto exit_here; 952 959 } 953 960 … … 995 1002 ) 996 1003 { 997 SL_RET0(_("sh_error_handle"));1004 goto exit_here; 998 1005 } 999 1006 1000 1007 if ((severity & SH_ERR_NOT) != 0) 1001 1008 { 1002 SL_RET0(_("sh_error_handle"));1009 goto exit_here; 1003 1010 } 1004 1011 … … 1017 1024 lmsg->line = line; 1018 1025 lmsg->status = status; 1019 own_block = 0;1020 1021 1026 1022 1027 /* Format the log message with timestamp etc. 1023 1028 * Allocate lmsg->msg 1024 1029 */ 1025 own_block = 1;1026 1030 va_start (vl, msg_id); 1027 1031 (void) sh_error_string (lmsg, vl); … … 1311 1315 SH_FREE( lmsg ); 1312 1316 own_block = 0; 1317 1318 exit_here: 1319 1320 SH_MUTEX_RECURSIVE_UNLOCK(mutex_err_handle); 1313 1321 1314 1322 /*@i@*/SL_RET0(_("sh_error_handle"));
Note:
See TracChangeset
for help on using the changeset viewer.