2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
24 /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
25 /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
26 /*%% (c) Copyright 1993, 1994 Novell, Inc. */
27 /*%% $XConsortium: iserror.c /main/3 1995/10/23 11:38:16 rswiston $ */
29 static char sccsid[] = "@(#)iserror.c 1.10 89/07/17 Copyr 1988 Sun Micro";
32 * Copyright (c) 1988 by Sun Microsystems, Inc.
39 * NetISAM error handling functions.
43 #include "isam_impl.h"
47 #define LOG_USER LOG_INFO
52 * Fatal error. Display message and terminate program.
55 static int (*fatal_error_user_handler)(); /* set by iscntl(..,ISCNTL_FATAL,..) */
63 if (fatal_error_user_handler) {
64 logerr = fatal_error_user_handler(msg); /* User returns 1 in order
72 openlog("NetISAM", LOG_PID, LOG_USER);
74 /* Free one UNIX for syslog */
77 syslog(LOG_ERR, "Fatal error: %s - UNIX errno %d", msg, errno);
88 extern int _is_rpcnetisamd; /* is 1 if this is rpc.netisamd */
89 extern int _is_netisamlockd; /* is 1 if this is netisamlockd */
92 if (fatal_error_user_handler) {
93 logerr = fatal_error_user_handler(msg); /* User returns 1 in order
101 openlog("NetISAM", LOG_PID, LOG_USER);
103 /* Free one UNIX for syslog */
106 syslog(LOG_ERR, "Fatal error: %s - UNIX errno %d", msg, errno);
115 openlog("NetISAM", LOG_PID, LOG_USER);
116 syslog(LOG_ERR, msg);
119 /* Set user specified fatal_error handler */
120 int (*_isfatal_error_set_func(func))()
125 oldfunc = fatal_error_user_handler;
126 fatal_error_user_handler = func;
132 * _setiserrno2(error, isstat1, isstat2)
134 * Set iserrno variable.
138 _setiserrno2(error, is1, is2)
148 * _seterr_errcode(errcode)
150 * Set all error and status variable from errcode structure.
154 _seterr_errcode(errcode)
155 register struct errcode *errcode;
157 iserrno = errcode->iserrno;
158 isstat1 = errcode->isstat[0];
159 isstat2 = errcode->isstat[1];
160 isstat3 = errcode->isstat[2];
161 isstat4 = errcode->isstat[3];