1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved. 24*0Sstevel@tonic-gate * Use is subject to license terms. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 28*0Sstevel@tonic-gate /* All Rights Reserved */ 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate 31*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 32*0Sstevel@tonic-gate 33*0Sstevel@tonic-gate /* 34*0Sstevel@tonic-gate * Implements the "putdgrp" command. 35*0Sstevel@tonic-gate */ 36*0Sstevel@tonic-gate #include <sys/types.h> 37*0Sstevel@tonic-gate #include <stdio.h> 38*0Sstevel@tonic-gate #include <stdlib.h> 39*0Sstevel@tonic-gate #include <string.h> 40*0Sstevel@tonic-gate #include <errno.h> 41*0Sstevel@tonic-gate #include <unistd.h> 42*0Sstevel@tonic-gate #include <fmtmsg.h> 43*0Sstevel@tonic-gate #include <devmgmt.h> 44*0Sstevel@tonic-gate #include <devtab.h> 45*0Sstevel@tonic-gate 46*0Sstevel@tonic-gate 47*0Sstevel@tonic-gate /* 48*0Sstevel@tonic-gate * General Purpose Constants 49*0Sstevel@tonic-gate * TRUE Boolean TRUE (if not already defined) 50*0Sstevel@tonic-gate * FALSE Boolean FALSE (if not already defined) 51*0Sstevel@tonic-gate */ 52*0Sstevel@tonic-gate 53*0Sstevel@tonic-gate #ifndef TRUE 54*0Sstevel@tonic-gate #define TRUE (1) 55*0Sstevel@tonic-gate #endif 56*0Sstevel@tonic-gate 57*0Sstevel@tonic-gate #ifndef FALSE 58*0Sstevel@tonic-gate #define FALSE (0) 59*0Sstevel@tonic-gate #endif 60*0Sstevel@tonic-gate 61*0Sstevel@tonic-gate /* 62*0Sstevel@tonic-gate * Exit codes 63*0Sstevel@tonic-gate * EX_OK All went well 64*0Sstevel@tonic-gate * EX_ERROR Usage or internal error 65*0Sstevel@tonic-gate * EX_DGROUP Had trouble accessing/reading/writing the 66*0Sstevel@tonic-gate * device-group table 67*0Sstevel@tonic-gate * EX_NODGRP The specified device-group does not exist 68*0Sstevel@tonic-gate * EX_NOMEM One or more device-group members requested for 69*0Sstevel@tonic-gate * removal was not defined for the device 70*0Sstevel@tonic-gate */ 71*0Sstevel@tonic-gate 72*0Sstevel@tonic-gate #define EX_OK 0 73*0Sstevel@tonic-gate #define EX_ERROR 1 74*0Sstevel@tonic-gate #define EX_DGROUP 2 75*0Sstevel@tonic-gate #define EX_NODGRP 3 76*0Sstevel@tonic-gate #define EX_NOMEM 4 77*0Sstevel@tonic-gate 78*0Sstevel@tonic-gate 79*0Sstevel@tonic-gate /* 80*0Sstevel@tonic-gate * Error messages 81*0Sstevel@tonic-gate */ 82*0Sstevel@tonic-gate 83*0Sstevel@tonic-gate #define E_USAGE "usage: putdgrp [-d] dgroup [device [...]]" 84*0Sstevel@tonic-gate #define E_NODGRP "Device-group does not exist in table: %s" 85*0Sstevel@tonic-gate #define E_NOTAMEM "Device-group member not found: %s" 86*0Sstevel@tonic-gate #define E_NODGRPTAB "Cannot open the device-group table: %s" 87*0Sstevel@tonic-gate #define E_NOMKTAB "Cannot create a new device-group table: %s" 88*0Sstevel@tonic-gate #define E_INTERNAL "Internal error, errno=%d" 89*0Sstevel@tonic-gate 90*0Sstevel@tonic-gate 91*0Sstevel@tonic-gate /* 92*0Sstevel@tonic-gate * Macros 93*0Sstevel@tonic-gate * stdmsg(r,l,s,t) Using fmtmsg(), write a standard message to the 94*0Sstevel@tonic-gate * standard error stream. 95*0Sstevel@tonic-gate * Where: 96*0Sstevel@tonic-gate * r The recoverability of the error 97*0Sstevel@tonic-gate * l The label-component 98*0Sstevel@tonic-gate * s The severity-component 99*0Sstevel@tonic-gate * t The text-component 100*0Sstevel@tonic-gate */ 101*0Sstevel@tonic-gate 102*0Sstevel@tonic-gate #define stdmsg(r,l,s,t) (void) fmtmsg(MM_PRINT|MM_UTIL|r,l,s,t,MM_NULLACT,MM_NULLTAG) 103*0Sstevel@tonic-gate 104*0Sstevel@tonic-gate 105*0Sstevel@tonic-gate /* 106*0Sstevel@tonic-gate * Static data 107*0Sstevel@tonic-gate * msg Space for message's text-component 108*0Sstevel@tonic-gate */ 109*0Sstevel@tonic-gate 110*0Sstevel@tonic-gate static char msg[256]; /* Space for text of message */ 111*0Sstevel@tonic-gate 112*0Sstevel@tonic-gate /* 113*0Sstevel@tonic-gate * char *mklbl(cmd) 114*0Sstevel@tonic-gate * char *cmd 115*0Sstevel@tonic-gate * 116*0Sstevel@tonic-gate * This function builds a standard label from the command used to invoke 117*0Sstevel@tonic-gate * this process and the standard label prefix ("UX:") 118*0Sstevel@tonic-gate * 119*0Sstevel@tonic-gate * Arguments: 120*0Sstevel@tonic-gate * char *cmd The command used to invoke this process. 121*0Sstevel@tonic-gate * 122*0Sstevel@tonic-gate * Returns: char * 123*0Sstevel@tonic-gate * Pointer to malloc()ed space containing the standard label, 124*0Sstevel@tonic-gate * or (char *) NULL if an error occurred. 125*0Sstevel@tonic-gate */ 126*0Sstevel@tonic-gate 127*0Sstevel@tonic-gate static char * 128*0Sstevel@tonic-gate mklbl(cmd) 129*0Sstevel@tonic-gate char *cmd; 130*0Sstevel@tonic-gate { 131*0Sstevel@tonic-gate /* Automatic data */ 132*0Sstevel@tonic-gate char *rtn; /* Value to return */ 133*0Sstevel@tonic-gate char *p; /* Temporary */ 134*0Sstevel@tonic-gate 135*0Sstevel@tonic-gate /* Find the 1st char of the basename of the command */ 136*0Sstevel@tonic-gate if (p = strrchr(cmd, '/')) p++; 137*0Sstevel@tonic-gate else p = cmd; 138*0Sstevel@tonic-gate 139*0Sstevel@tonic-gate /* Allocate and build the string value to return */ 140*0Sstevel@tonic-gate if (rtn = (char *) malloc(strlen("UX:")+strlen(p)+1)) { 141*0Sstevel@tonic-gate (void) strcpy(rtn, "UX:"); 142*0Sstevel@tonic-gate (void) strcat(rtn, p); 143*0Sstevel@tonic-gate } 144*0Sstevel@tonic-gate 145*0Sstevel@tonic-gate /* Now that we've done all of this work, set up the environemnt 146*0Sstevel@tonic-gate * so that only the text-component is written (some requirements 147*0Sstevel@tonic-gate * say that standard messages are to be non-standard in SVR4.0, 148*0Sstevel@tonic-gate * this is supposed to change in SVR4.1) 149*0Sstevel@tonic-gate */ 150*0Sstevel@tonic-gate 151*0Sstevel@tonic-gate (void) putenv("MSGVERB=text"); 152*0Sstevel@tonic-gate 153*0Sstevel@tonic-gate /* Done */ 154*0Sstevel@tonic-gate return(rtn); 155*0Sstevel@tonic-gate } 156*0Sstevel@tonic-gate 157*0Sstevel@tonic-gate /* 158*0Sstevel@tonic-gate * putdgrp [-d] dgroup [device [...]] 159*0Sstevel@tonic-gate * 160*0Sstevel@tonic-gate * Options: 161*0Sstevel@tonic-gate * -d 162*0Sstevel@tonic-gate * 163*0Sstevel@tonic-gate * Arguments: 164*0Sstevel@tonic-gate * dgroup 165*0Sstevel@tonic-gate * device 166*0Sstevel@tonic-gate * 167*0Sstevel@tonic-gate * Exit values: 168*0Sstevel@tonic-gate */ 169*0Sstevel@tonic-gate 170*0Sstevel@tonic-gate main(argc, argv) 171*0Sstevel@tonic-gate int argc; /* Argument count */ 172*0Sstevel@tonic-gate char *argv[]; /* Argument list */ 173*0Sstevel@tonic-gate { 174*0Sstevel@tonic-gate /* Automatic data */ 175*0Sstevel@tonic-gate char **plist; /* Ptr to list of nonmembers */ 176*0Sstevel@tonic-gate char *lbl; /* Ptr to label for messages */ 177*0Sstevel@tonic-gate char *dgroup; /* Ptr to <dgroup> on command-line */ 178*0Sstevel@tonic-gate char *p; /* Temp ptr to char */ 179*0Sstevel@tonic-gate int noerr; /* FLAG, TRUE if all's well */ 180*0Sstevel@tonic-gate int d_seen; /* TRUE if -a seen on command-line */ 181*0Sstevel@tonic-gate int optchar; /* Option extracted */ 182*0Sstevel@tonic-gate int exitcd; /* Value to return at exit */ 183*0Sstevel@tonic-gate int nmems; /* Number of members on the cmd */ 184*0Sstevel@tonic-gate 185*0Sstevel@tonic-gate 186*0Sstevel@tonic-gate /* Generate the label for messages */ 187*0Sstevel@tonic-gate lbl = mklbl(argv[0]); 188*0Sstevel@tonic-gate 189*0Sstevel@tonic-gate /* Extract arguments - validate usage */ 190*0Sstevel@tonic-gate noerr = TRUE; 191*0Sstevel@tonic-gate d_seen = FALSE; 192*0Sstevel@tonic-gate opterr = FALSE; 193*0Sstevel@tonic-gate while ((optchar = getopt(argc, argv, "d:")) != EOF) switch (optchar) { 194*0Sstevel@tonic-gate 195*0Sstevel@tonic-gate case 'd': 196*0Sstevel@tonic-gate if (!d_seen) 197*0Sstevel@tonic-gate { 198*0Sstevel@tonic-gate d_seen = TRUE; 199*0Sstevel@tonic-gate dgroup = optarg; 200*0Sstevel@tonic-gate } 201*0Sstevel@tonic-gate else noerr = FALSE; 202*0Sstevel@tonic-gate break; 203*0Sstevel@tonic-gate 204*0Sstevel@tonic-gate case '?': 205*0Sstevel@tonic-gate default: 206*0Sstevel@tonic-gate noerr = FALSE; 207*0Sstevel@tonic-gate } 208*0Sstevel@tonic-gate 209*0Sstevel@tonic-gate 210*0Sstevel@tonic-gate /* Write a usage message if we've seen a blatant error */ 211*0Sstevel@tonic-gate if (!noerr || (!d_seen && ((nmems = argc - optind - 1) < 0)) || 212*0Sstevel@tonic-gate (d_seen && ((nmems = argc - optind) < 0))) { 213*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, E_USAGE); 214*0Sstevel@tonic-gate exit(EX_ERROR); 215*0Sstevel@tonic-gate } 216*0Sstevel@tonic-gate 217*0Sstevel@tonic-gate 218*0Sstevel@tonic-gate /* Set up */ 219*0Sstevel@tonic-gate exitcd = EX_OK; 220*0Sstevel@tonic-gate 221*0Sstevel@tonic-gate 222*0Sstevel@tonic-gate /* -d on the command line ? */ 223*0Sstevel@tonic-gate if (d_seen) { 224*0Sstevel@tonic-gate 225*0Sstevel@tonic-gate /* 226*0Sstevel@tonic-gate * Determine case (removing a device group or members 227*0Sstevel@tonic-gate * of that device group. 228*0Sstevel@tonic-gate */ 229*0Sstevel@tonic-gate 230*0Sstevel@tonic-gate if (nmems == 0) { 231*0Sstevel@tonic-gate 232*0Sstevel@tonic-gate /* putdgrp -d dgroup */ 233*0Sstevel@tonic-gate 234*0Sstevel@tonic-gate /* Attempt to remove the specified device */ 235*0Sstevel@tonic-gate if (!(_rmdgrptabrec(dgroup))) switch(errno) { 236*0Sstevel@tonic-gate 237*0Sstevel@tonic-gate /* 238*0Sstevel@tonic-gate * EINVAL indicates that the named device-group was 239*0Sstevel@tonic-gate * not found in the device-group table. 240*0Sstevel@tonic-gate */ 241*0Sstevel@tonic-gate 242*0Sstevel@tonic-gate case EINVAL: 243*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NODGRP, dgroup); 244*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 245*0Sstevel@tonic-gate exitcd = EX_NODGRP; 246*0Sstevel@tonic-gate break; 247*0Sstevel@tonic-gate 248*0Sstevel@tonic-gate /* 249*0Sstevel@tonic-gate * ENOENT indicates that the device-group table can't 250*0Sstevel@tonic-gate * be found. 251*0Sstevel@tonic-gate */ 252*0Sstevel@tonic-gate 253*0Sstevel@tonic-gate case ENOENT: 254*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NODGRPTAB, _dgrptabpath()); 255*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 256*0Sstevel@tonic-gate exitcd = EX_DGROUP; 257*0Sstevel@tonic-gate break; 258*0Sstevel@tonic-gate 259*0Sstevel@tonic-gate /* 260*0Sstevel@tonic-gate * EACCES indicates that there was a problem reading the 261*0Sstevel@tonic-gate * old device-group table or creating the new table. If the 262*0Sstevel@tonic-gate * old table is readable, assume that we can't create the 263*0Sstevel@tonic-gate * new table. Otherwise, assume that the old table isn't 264*0Sstevel@tonic-gate * accessible. 265*0Sstevel@tonic-gate */ 266*0Sstevel@tonic-gate 267*0Sstevel@tonic-gate case EACCES: 268*0Sstevel@tonic-gate p = _dgrptabpath(); 269*0Sstevel@tonic-gate if (access(p, R_OK) == 0) 270*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NOMKTAB, p); 271*0Sstevel@tonic-gate else 272*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NODGRPTAB, p); 273*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 274*0Sstevel@tonic-gate exitcd = EX_DGROUP; 275*0Sstevel@tonic-gate break; 276*0Sstevel@tonic-gate 277*0Sstevel@tonic-gate /* 278*0Sstevel@tonic-gate * Some strange problem... 279*0Sstevel@tonic-gate */ 280*0Sstevel@tonic-gate 281*0Sstevel@tonic-gate default: 282*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_INTERNAL, errno); 283*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 284*0Sstevel@tonic-gate exitcd = EX_ERROR; 285*0Sstevel@tonic-gate 286*0Sstevel@tonic-gate } /* End switch */ 287*0Sstevel@tonic-gate } 288*0Sstevel@tonic-gate else { 289*0Sstevel@tonic-gate 290*0Sstevel@tonic-gate /* putdgrp -d dgroup device [device [...]] */ 291*0Sstevel@tonic-gate 292*0Sstevel@tonic-gate /* 293*0Sstevel@tonic-gate * Attempt to remove the specified devices from the 294*0Sstevel@tonic-gate * specified device-group. 295*0Sstevel@tonic-gate */ 296*0Sstevel@tonic-gate if (!(_rmdgrpmems(dgroup, &argv[optind], &plist))) switch(errno) { 297*0Sstevel@tonic-gate 298*0Sstevel@tonic-gate /* 299*0Sstevel@tonic-gate * ENODEV indicates that a named device was not part 300*0Sstevel@tonic-gate * of the specified device group. 301*0Sstevel@tonic-gate */ 302*0Sstevel@tonic-gate 303*0Sstevel@tonic-gate case ENODEV: 304*0Sstevel@tonic-gate exitcd = EX_NOMEM; 305*0Sstevel@tonic-gate for (; *plist; plist++) { 306*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NOTAMEM, *plist); 307*0Sstevel@tonic-gate stdmsg(MM_RECOVER, lbl, MM_WARNING, msg); 308*0Sstevel@tonic-gate } 309*0Sstevel@tonic-gate break; 310*0Sstevel@tonic-gate 311*0Sstevel@tonic-gate /* 312*0Sstevel@tonic-gate * EINVAL indicates that the named device-group is not 313*0Sstevel@tonic-gate * defined in the device-group table. 314*0Sstevel@tonic-gate */ 315*0Sstevel@tonic-gate 316*0Sstevel@tonic-gate case EINVAL: 317*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NODGRP, dgroup); 318*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 319*0Sstevel@tonic-gate exitcd = EX_NODGRP; 320*0Sstevel@tonic-gate break; 321*0Sstevel@tonic-gate 322*0Sstevel@tonic-gate /* 323*0Sstevel@tonic-gate * ENOENT indicates that the device table can't 324*0Sstevel@tonic-gate * be found. 325*0Sstevel@tonic-gate */ 326*0Sstevel@tonic-gate 327*0Sstevel@tonic-gate case ENOENT: 328*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NODGRPTAB, _dgrptabpath()); 329*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 330*0Sstevel@tonic-gate exitcd = EX_DGROUP; 331*0Sstevel@tonic-gate break; 332*0Sstevel@tonic-gate 333*0Sstevel@tonic-gate /* 334*0Sstevel@tonic-gate * EACCES indicates that there was a problem reading the 335*0Sstevel@tonic-gate * old device table or creating the new table. If the 336*0Sstevel@tonic-gate * old table is readable, assume that we can't create the 337*0Sstevel@tonic-gate * new table. Otherwise, assume that the old table isn't 338*0Sstevel@tonic-gate * accessible. 339*0Sstevel@tonic-gate */ 340*0Sstevel@tonic-gate 341*0Sstevel@tonic-gate case EACCES: 342*0Sstevel@tonic-gate p = _dgrptabpath(); 343*0Sstevel@tonic-gate if (access(p, R_OK) == 0) 344*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NOMKTAB, p); 345*0Sstevel@tonic-gate else 346*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NODGRPTAB, p); 347*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 348*0Sstevel@tonic-gate exitcd = EX_DGROUP; 349*0Sstevel@tonic-gate break; 350*0Sstevel@tonic-gate 351*0Sstevel@tonic-gate /* 352*0Sstevel@tonic-gate * Some strange problem... 353*0Sstevel@tonic-gate */ 354*0Sstevel@tonic-gate 355*0Sstevel@tonic-gate default: 356*0Sstevel@tonic-gate (void) sprintf(msg, E_INTERNAL, errno); 357*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 358*0Sstevel@tonic-gate exitcd = EX_ERROR; 359*0Sstevel@tonic-gate 360*0Sstevel@tonic-gate } /* End switch */ 361*0Sstevel@tonic-gate 362*0Sstevel@tonic-gate } /* End "putdgrp -d device attr [...]" case */ 363*0Sstevel@tonic-gate 364*0Sstevel@tonic-gate 365*0Sstevel@tonic-gate } /* End -d case */ 366*0Sstevel@tonic-gate 367*0Sstevel@tonic-gate else { 368*0Sstevel@tonic-gate /* Standard case (no -d on the command) */ 369*0Sstevel@tonic-gate if (!(_adddgrptabrec(argv[optind], &argv[optind+1]))) switch(errno) { 370*0Sstevel@tonic-gate 371*0Sstevel@tonic-gate /* 372*0Sstevel@tonic-gate * ENOENT indicates that the device-group table does not exist. 373*0Sstevel@tonic-gate */ 374*0Sstevel@tonic-gate 375*0Sstevel@tonic-gate case ENOENT: 376*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NODGRPTAB, _dgrptabpath()); 377*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 378*0Sstevel@tonic-gate exitcd = EX_DGROUP; 379*0Sstevel@tonic-gate break; 380*0Sstevel@tonic-gate 381*0Sstevel@tonic-gate /* 382*0Sstevel@tonic-gate * EACCES indicates that the device-group table could not be 383*0Sstevel@tonic-gate * opened or the new device-group table could not be created. 384*0Sstevel@tonic-gate */ 385*0Sstevel@tonic-gate 386*0Sstevel@tonic-gate case EACCES: 387*0Sstevel@tonic-gate p = _dgrptabpath(); 388*0Sstevel@tonic-gate if (access(p, R_OK) == 0) 389*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NOMKTAB, p); 390*0Sstevel@tonic-gate else 391*0Sstevel@tonic-gate (void) snprintf(msg, sizeof(msg), E_NODGRPTAB, p); 392*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 393*0Sstevel@tonic-gate exitcd = EX_DGROUP; 394*0Sstevel@tonic-gate break; 395*0Sstevel@tonic-gate 396*0Sstevel@tonic-gate /* 397*0Sstevel@tonic-gate * Some strange error (memory?) 398*0Sstevel@tonic-gate */ 399*0Sstevel@tonic-gate 400*0Sstevel@tonic-gate default: 401*0Sstevel@tonic-gate (void) sprintf(msg, E_INTERNAL, errno); 402*0Sstevel@tonic-gate stdmsg(MM_NRECOV, lbl, MM_ERROR, msg); 403*0Sstevel@tonic-gate exitcd = EX_ERROR; 404*0Sstevel@tonic-gate } 405*0Sstevel@tonic-gate } 406*0Sstevel@tonic-gate 407*0Sstevel@tonic-gate /* Done. Return exit code (determined above) */ 408*0Sstevel@tonic-gate return(exitcd); 409*0Sstevel@tonic-gate } /* main() */ 410