Commit 34965563 authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard

- 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)
parent d31c1f66
......@@ -15,7 +15,6 @@
#include <fcntl.h>
#include <unistd.h>
#include <termios.h>
#include <errno.h>
#include "console.h"
#include "options.h"
......
......@@ -66,7 +66,7 @@ struct CCPRIVATE
UINT msetrgb; /* # of SETRGBSTRING message (today not used) */
RECT old3angle; /* last position of l-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 s;
int l; /* for temporary storing of hue,sat,lum */
......
......@@ -25,10 +25,8 @@
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/fcntl.h>
#include <unistd.h>
#include <stdlib.h>
......@@ -40,7 +38,6 @@
#include "winuser.h"
#include "winerror.h"
#include "mmsystem.h"
#include "thread.h"
#include "debugtools.h"
#include "initguid.h"
......
......@@ -488,7 +488,7 @@ static int CreateSpoolFile(LPCSTR pszOutput)
{
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
......@@ -498,8 +498,8 @@ static int CreateSpoolFile(LPCSTR pszOutput)
if ((fd = open(fullName.long_name, O_CREAT | O_TRUNC | O_WRONLY , 0600)) < 0)
{
ERR("Failed to create spool file %s, errno = %d\n",
fullName.long_name, errno);
ERR("Failed to create spool file %s (%s)\n",
fullName.long_name, strerror(errno));
}
}
return fd;
......
......@@ -8,7 +8,6 @@
#include "config.h"
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
......
......@@ -38,7 +38,6 @@ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include <math.h>
#include <string.h>
#include <sys/types.h>
#include <errno.h>
#include <limits.h>
#include <sys/timeb.h>
......
......@@ -1283,7 +1283,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
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);
}
else
......
......@@ -243,6 +243,9 @@ INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
InternetCrackUrlA(lpszReferrer, 0, 0, &UrlComponents);
if (strlen(UrlComponents.lpszHostName))
lpwhr->lpszHostName = HEAP_strdupA(GetProcessHeap(), 0, UrlComponents.lpszHostName);
} else {
lpwhr->lpszHostName = HEAP_strdupA(GetProcessHeap(), 0,
lpwhs->lpszServerName);
}
if (hIC->lpfnStatusCB)
......@@ -821,7 +824,7 @@ BOOL HTTP_OpenConnection(LPWININETHTTPREQA lpwhr)
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;
}
......
......@@ -281,7 +281,7 @@ static LONG JSTCK_GetPosEx(DWORD dwDevID, LPJOYINFOEX lpInfo)
/* EAGAIN is returned when the queue is empty */
if (errno != EAGAIN) {
/* 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
dev_stat = read(dev, &js, sizeof(js));
......
......@@ -382,8 +382,17 @@ static int midiOpenSeq(void)
midiSeqFD = open(MIDI_SEQ, O_RDWR, 0);
if (midiSeqFD == -1) {
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;
return -1;
}
......
......@@ -2,21 +2,18 @@
* Main initialization code
*/
#include <assert.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include "windef.h"
#include "wine/winbase16.h"
#include "main.h"
#include "drive.h"
#include "file.h"
#include "options.h"
#include "process.h"
#include "shell.h"
#include "debugtools.h"
#include "server.h"
......
......@@ -11,22 +11,13 @@
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "windef.h"
#include "wine/winbase16.h"
#include "winerror.h"
#include "file.h"
#include "global.h"
#include "heap.h"
#include "module.h"
#include "snoop.h"
#include "neexe.h"
#include "dosexe.h"
#include "process.h"
#include "syslevel.h"
#include "thread.h"
#include "selectors.h"
#include "stackframe.h"
#include "task.h"
#include "debugtools.h"
#include "callback.h"
#include "loadorder.h"
......
......@@ -14,19 +14,16 @@
#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include "wine/winbase16.h"
#include "neexe.h"
#include "global.h"
#include "task.h"
#include "selectors.h"
#include "file.h"
#include "module.h"
#include "stackframe.h"
#include "builtin16.h"
#include "debugtools.h"
#include "toolhelp.h"
DECLARE_DEBUG_CHANNEL(dll);
DECLARE_DEBUG_CHANNEL(fixup);
......
......@@ -23,31 +23,13 @@
* 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
#include <sys/mman.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "wine/winbase16.h"
#include "winerror.h"
#include "callback.h"
#include "file.h"
#include "heap.h"
#include "neexe.h"
#include "process.h"
#include "thread.h"
#include "module.h"
#include "global.h"
#include "task.h"
#include "snoop.h"
#include "server.h"
#include "debugtools.h"
......
......@@ -468,7 +468,7 @@ INT16 WINAPI OpenComm16(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue)
fd = open(COM[port].devicename, O_RDWR | O_NONBLOCK);
if (fd == -1) {
ERR("error=%d\n", errno);
ERR("Couldn't open %s ! (%s)\n", COM[port].devicename, strerror(errno));
return IE_HARDWARE;
} else {
unknown[port] = SEGPTR_ALLOC(40);
......@@ -1992,11 +1992,7 @@ BOOL WINAPI SetCommState(HANDLE handle,LPDCB lpdcb)
int save_error = errno;
commerror = WinError();
close( fd );
#ifdef HAVE_STRERROR
ERR("tcgetattr error '%s'\n", strerror(save_error));
#else
ERR("tcgetattr error %d\n", save_error);
#endif
return FALSE;
}
......@@ -2260,11 +2256,7 @@ BOOL WINAPI SetCommState(HANDLE handle,LPDCB lpdcb)
int save_error=errno;
commerror = WinError();
close( fd );
#ifdef HAVE_STRERROR
ERR("tcgetattr error '%s'\n", strerror(save_error));
#else
ERR("tcgetattr error %d\n", save_error);
#endif
return FALSE;
} else {
commerror = 0;
......@@ -2291,11 +2283,7 @@ BOOL WINAPI GetCommState(HANDLE handle, LPDCB lpdcb)
}
if (tcgetattr(fd, &port) == -1) {
int save_error=errno;
#ifdef HAVE_STRERROR
ERR("tcgetattr error '%s'\n", strerror(save_error));
#else
ERR("tcgetattr error %d\n", save_error);
#endif
commerror = WinError();
close( fd );
return FALSE;
......
......@@ -128,11 +128,11 @@ void DEBUG_ExternalDebugger(void)
if (status == -1)
{
if (dbg_no_xterm)
fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"%s %s %s\", errno = %d\n",
dbg_external, dbg_wine_location, pid_string, errno);
fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"%s %s %s\" (%s)\n",
dbg_external, dbg_wine_location, pid_string, strerror(errno));
else
fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"xterm -e %s %s %s\", errno = %d\n",
dbg_external, dbg_wine_location, pid_string, errno);
fprintf(stderr, "DEBUG_ExternalDebugger failed to execute \"xterm -e %s %s %s\" (%s)\n",
dbg_external, dbg_wine_location, pid_string, strerror(errno));
}
}
......
......@@ -45,27 +45,16 @@
*
*/
#include "config.h"
#include <X11/Xatom.h>
#include "ts_xlib.h"
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
#include "clipboard.h"
#include "message.h"
#include "win.h"
#include "x11drv.h"
#include "bitmap.h"
#include "heap.h"
#include "options.h"
#include "debugtools.h"
......@@ -297,9 +286,6 @@ BOOL X11DRV_CLIPBOARD_LaunchServer()
ERR("Could not create wait object. Clipboard server won't start!\n");
else
{
/* Make the event object's handle global */
selectionClearEvent = ConvertToGlobalHandle(selectionClearEvent);
/* Wait until we lose the selection, timing out after a minute */
TRACE("Waiting for clipboard server to acquire selection\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment