- made the MIDI sequencer error message much better for confused users

to be found on #WineHQ
- use strerror instead of errno at important places
- got rid of HAVE_STRERROR macro
- removed some #include:s (hopefully I didn't break anything)
This commit is contained in:
Andreas Mohr 2000-08-26 20:31:48 +00:00 committed by Alexandre Julliard
parent d31c1f6647
commit 349655636b
17 changed files with 26 additions and 79 deletions

View File

@ -15,7 +15,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <termios.h> #include <termios.h>
#include <errno.h>
#include "console.h" #include "console.h"
#include "options.h" #include "options.h"

View File

@ -66,7 +66,7 @@ struct CCPRIVATE
UINT msetrgb; /* # of SETRGBSTRING message (today not used) */ UINT msetrgb; /* # of SETRGBSTRING message (today not used) */
RECT old3angle; /* last position of l-marker */ RECT old3angle; /* last position of l-marker */
RECT oldcross; /* last position of color/satuation marker */ RECT oldcross; /* last position of color/satuation marker */
BOOL updating; /* to prevent recursive WM_COMMAND/EN_UPDATE procesing */ BOOL updating; /* to prevent recursive WM_COMMAND/EN_UPDATE processing */
int h; int h;
int s; int s;
int l; /* for temporary storing of hue,sat,lum */ int l; /* for temporary storing of hue,sat,lum */

View File

@ -25,10 +25,8 @@
#include "config.h" #include "config.h"
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h>
#include <sys/fcntl.h> #include <sys/fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
@ -40,7 +38,6 @@
#include "winuser.h" #include "winuser.h"
#include "winerror.h" #include "winerror.h"
#include "mmsystem.h" #include "mmsystem.h"
#include "thread.h"
#include "debugtools.h" #include "debugtools.h"
#include "initguid.h" #include "initguid.h"

View File

@ -488,7 +488,7 @@ static int CreateSpoolFile(LPCSTR pszOutput)
{ {
DOS_FULL_NAME fullName; DOS_FULL_NAME fullName;
TRACE("Just assume its a file\n"); TRACE("Just assume it's a file\n");
/** /**
* The file name can be dos based, we have to find its * The file name can be dos based, we have to find its
@ -498,8 +498,8 @@ static int CreateSpoolFile(LPCSTR pszOutput)
if ((fd = open(fullName.long_name, O_CREAT | O_TRUNC | O_WRONLY , 0600)) < 0) if ((fd = open(fullName.long_name, O_CREAT | O_TRUNC | O_WRONLY , 0600)) < 0)
{ {
ERR("Failed to create spool file %s, errno = %d\n", ERR("Failed to create spool file %s (%s)\n",
fullName.long_name, errno); fullName.long_name, strerror(errno));
} }
} }
return fd; return fd;

View File

@ -8,7 +8,6 @@
#include "config.h" #include "config.h"
#include <errno.h>
#include <signal.h> #include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>

View File

@ -38,7 +38,6 @@ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <errno.h>
#include <limits.h> #include <limits.h>
#include <sys/timeb.h> #include <sys/timeb.h>

View File

@ -1283,7 +1283,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
if (connect(nsocket, (struct sockaddr *)&socketAddr, sizeof(socketAddr)) < 0) if (connect(nsocket, (struct sockaddr *)&socketAddr, sizeof(socketAddr)) < 0)
{ {
ERR("Unable to connect: errno(%d)\n", errno); ERR("Unable to connect (%s)\n", strerror(errno));
INTERNET_SetLastError(ERROR_INTERNET_CANNOT_CONNECT); INTERNET_SetLastError(ERROR_INTERNET_CANNOT_CONNECT);
} }
else else

View File

@ -243,6 +243,9 @@ INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
InternetCrackUrlA(lpszReferrer, 0, 0, &UrlComponents); InternetCrackUrlA(lpszReferrer, 0, 0, &UrlComponents);
if (strlen(UrlComponents.lpszHostName)) if (strlen(UrlComponents.lpszHostName))
lpwhr->lpszHostName = HEAP_strdupA(GetProcessHeap(), 0, UrlComponents.lpszHostName); lpwhr->lpszHostName = HEAP_strdupA(GetProcessHeap(), 0, UrlComponents.lpszHostName);
} else {
lpwhr->lpszHostName = HEAP_strdupA(GetProcessHeap(), 0,
lpwhs->lpszServerName);
} }
if (hIC->lpfnStatusCB) if (hIC->lpfnStatusCB)
@ -821,7 +824,7 @@ BOOL HTTP_OpenConnection(LPWININETHTTPREQA lpwhr)
if (SOCKET_ERROR == result) if (SOCKET_ERROR == result)
{ {
WARN("Unable to connect to host: %d\n", errno); WARN("Unable to connect to host (%s)\n", strerror(errno));
goto lend; goto lend;
} }

View File

@ -281,7 +281,7 @@ static LONG JSTCK_GetPosEx(DWORD dwDevID, LPJOYINFOEX lpInfo)
/* EAGAIN is returned when the queue is empty */ /* EAGAIN is returned when the queue is empty */
if (errno != EAGAIN) { if (errno != EAGAIN) {
/* FIXME: error should not be ignored */ /* FIXME: error should not be ignored */
ERR("Error while reading joystick state (%d)\n", errno); ERR("Error while reading joystick state (%s)\n", strerror(errno));
} }
#else #else
dev_stat = read(dev, &js, sizeof(js)); dev_stat = read(dev, &js, sizeof(js));

View File

@ -382,8 +382,17 @@ static int midiOpenSeq(void)
midiSeqFD = open(MIDI_SEQ, O_RDWR, 0); midiSeqFD = open(MIDI_SEQ, O_RDWR, 0);
if (midiSeqFD == -1) { if (midiSeqFD == -1) {
if (midi_warn) if (midi_warn)
MESSAGE("Can't open MIDI device '%s', errno %d (%s) !\n", {
MIDI_SEQ, errno, strerror(errno)); MESSAGE("Can't open MIDI device '%s' ! (%s)%s\n",
MIDI_SEQ, strerror(errno),
errno == ENOENT ?
": create it ! (\"man MAKEDEV\" ?)" :
errno == ENODEV ?
": Load MIDI sequencer kernel driver !" :
errno == EACCES ?
": Grant access ! (\"man chmod\")" : ""
);
}
midi_warn = 0; midi_warn = 0;
return -1; return -1;
} }

View File

@ -2,21 +2,18 @@
* Main initialization code * Main initialization code
*/ */
#include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <errno.h>
#include "windef.h" #include "windef.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "main.h" #include "main.h"
#include "drive.h" #include "drive.h"
#include "file.h" #include "file.h"
#include "options.h" #include "options.h"
#include "process.h"
#include "shell.h" #include "shell.h"
#include "debugtools.h" #include "debugtools.h"
#include "server.h" #include "server.h"

View File

@ -11,22 +11,13 @@
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include "windef.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "winerror.h" #include "winerror.h"
#include "file.h"
#include "global.h"
#include "heap.h" #include "heap.h"
#include "module.h"
#include "snoop.h"
#include "neexe.h" #include "neexe.h"
#include "dosexe.h"
#include "process.h" #include "process.h"
#include "syslevel.h" #include "syslevel.h"
#include "thread.h"
#include "selectors.h" #include "selectors.h"
#include "stackframe.h"
#include "task.h"
#include "debugtools.h" #include "debugtools.h"
#include "callback.h" #include "callback.h"
#include "loadorder.h" #include "loadorder.h"

View File

@ -14,19 +14,16 @@
#include <unistd.h> #include <unistd.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include <errno.h>
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "neexe.h" #include "neexe.h"
#include "global.h" #include "global.h"
#include "task.h" #include "task.h"
#include "selectors.h"
#include "file.h" #include "file.h"
#include "module.h" #include "module.h"
#include "stackframe.h" #include "stackframe.h"
#include "builtin16.h" #include "builtin16.h"
#include "debugtools.h" #include "debugtools.h"
#include "toolhelp.h"
DECLARE_DEBUG_CHANNEL(dll); DECLARE_DEBUG_CHANNEL(dll);
DECLARE_DEBUG_CHANNEL(fixup); DECLARE_DEBUG_CHANNEL(fixup);

View File

@ -23,31 +23,13 @@
* NE_MODULE.module32. * NE_MODULE.module32.
*/ */
#include "config.h"
#include <errno.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h> #include <sys/mman.h>
#endif #endif
#include "windef.h"
#include "winbase.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "winerror.h" #include "winerror.h"
#include "callback.h"
#include "file.h"
#include "heap.h"
#include "neexe.h" #include "neexe.h"
#include "process.h" #include "process.h"
#include "thread.h"
#include "module.h"
#include "global.h"
#include "task.h"
#include "snoop.h" #include "snoop.h"
#include "server.h" #include "server.h"
#include "debugtools.h" #include "debugtools.h"

View File

@ -468,7 +468,7 @@ INT16 WINAPI OpenComm16(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue)
fd = open(COM[port].devicename, O_RDWR | O_NONBLOCK); fd = open(COM[port].devicename, O_RDWR | O_NONBLOCK);
if (fd == -1) { if (fd == -1) {
ERR("error=%d\n", errno); ERR("Couldn't open %s ! (%s)\n", COM[port].devicename, strerror(errno));
return IE_HARDWARE; return IE_HARDWARE;
} else { } else {
unknown[port] = SEGPTR_ALLOC(40); unknown[port] = SEGPTR_ALLOC(40);
@ -1992,11 +1992,7 @@ BOOL WINAPI SetCommState(HANDLE handle,LPDCB lpdcb)
int save_error = errno; int save_error = errno;
commerror = WinError(); commerror = WinError();
close( fd ); close( fd );
#ifdef HAVE_STRERROR
ERR("tcgetattr error '%s'\n", strerror(save_error)); ERR("tcgetattr error '%s'\n", strerror(save_error));
#else
ERR("tcgetattr error %d\n", save_error);
#endif
return FALSE; return FALSE;
} }
@ -2260,11 +2256,7 @@ BOOL WINAPI SetCommState(HANDLE handle,LPDCB lpdcb)
int save_error=errno; int save_error=errno;
commerror = WinError(); commerror = WinError();
close( fd ); close( fd );
#ifdef HAVE_STRERROR
ERR("tcgetattr error '%s'\n", strerror(save_error)); ERR("tcgetattr error '%s'\n", strerror(save_error));
#else
ERR("tcgetattr error %d\n", save_error);
#endif
return FALSE; return FALSE;
} else { } else {
commerror = 0; commerror = 0;
@ -2291,11 +2283,7 @@ BOOL WINAPI GetCommState(HANDLE handle, LPDCB lpdcb)
} }
if (tcgetattr(fd, &port) == -1) { if (tcgetattr(fd, &port) == -1) {
int save_error=errno; int save_error=errno;
#ifdef HAVE_STRERROR
ERR("tcgetattr error '%s'\n", strerror(save_error)); ERR("tcgetattr error '%s'\n", strerror(save_error));
#else
ERR("tcgetattr error %d\n", save_error);
#endif
commerror = WinError(); commerror = WinError();
close( fd ); close( fd );
return FALSE; return FALSE;

View File

@ -128,11 +128,11 @@ void DEBUG_ExternalDebugger(void)
if (status == -1) if (status == -1)
{ {
if (dbg_no_xterm) if (dbg_no_xterm)
fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"%s %s %s\", errno = %d\n", fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"%s %s %s\" (%s)\n",
dbg_external, dbg_wine_location, pid_string, errno); dbg_external, dbg_wine_location, pid_string, strerror(errno));
else else
fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"xterm -e %s %s %s\", errno = %d\n", fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"xterm -e %s %s %s\" (%s)\n",
dbg_external, dbg_wine_location, pid_string, errno); dbg_external, dbg_wine_location, pid_string, strerror(errno));
} }
} }

View File

@ -45,27 +45,16 @@
* *
*/ */
#include "config.h"
#include <X11/Xatom.h>
#include "ts_xlib.h" #include "ts_xlib.h"
#include <errno.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
#include "clipboard.h" #include "clipboard.h"
#include "message.h"
#include "win.h" #include "win.h"
#include "x11drv.h" #include "x11drv.h"
#include "bitmap.h"
#include "heap.h"
#include "options.h" #include "options.h"
#include "debugtools.h" #include "debugtools.h"
@ -297,9 +286,6 @@ BOOL X11DRV_CLIPBOARD_LaunchServer()
ERR("Could not create wait object. Clipboard server won't start!\n"); ERR("Could not create wait object. Clipboard server won't start!\n");
else else
{ {
/* Make the event object's handle global */
selectionClearEvent = ConvertToGlobalHandle(selectionClearEvent);
/* Wait until we lose the selection, timing out after a minute */ /* Wait until we lose the selection, timing out after a minute */
TRACE("Waiting for clipboard server to acquire selection\n"); TRACE("Waiting for clipboard server to acquire selection\n");