1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-26 20:02:37 +00:00
Files
Interlisp.maiko/src/perrno.c
Nick Briggs 3d9f090e70 Cleanup of includes and related changes based on include-what-you-use diagnostics (#436)
Remove unused #define PERCENT_OF_SCREEN in MyWindow.h
Move structures for dir.c to dirdefs.h where they are used
Resolve S_CHAR vs S_CHARACTER in favor of S_CHARACTER and cleanup #defines
Fix  = vs == bug in FSDEBUG code in dir.c
Eliminate duplicate/unused constant definitions in gcr.c
Declare static internal function bytecmp in mkatom.c
Update many source and include files to include headers for what they use
2022-08-10 11:07:57 -07:00

51 lines
1.6 KiB
C

/* $Id: perrno.c,v 1.4 2001/12/26 22:17:04 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved
*/
/************************************************************************/
/* */
/* (C) Copyright 1989-95 Venue. All Rights Reserved. */
/* Manufactured in the United States of America. */
/* */
/************************************************************************/
#include "version.h"
#include <errno.h> // for errno
#include <stdio.h> // for fprintf, perror, stderr, NULL
#include <string.h> // for strerror
#include "osmsg.h" // for OSMESSAGE_PRINT
#include "perrnodefs.h" // for err_mess, perrorn
/************************************************************************/
/* */
/* p e r r o r n */
/* */
/* Print the error message to go with a given error number. */
/* */
/************************************************************************/
void perrorn(char *s, int n) {
if (s != NULL && *s != '\0') { fprintf(stderr, "%s: ", s); }
fprintf(stderr, "%s\n", strerror(n));
}
/************************************************************************/
/* */
/* e r r _ m e s s */
/* */
/* Print an error message and call 'perror' to get the */
/* canonical error explanation. Called by emulator I/O code. */
/* */
/************************************************************************/
void err_mess(char *from, int no) {
int save_errno = errno; /* Save errno around OSMESSAGE_PRINT */
OSMESSAGE_PRINT({
fprintf(stderr, "System call error: %s errno=%d ", from, no);
perror("");
});
errno = save_errno;
}