summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2008-02-01 15:36:11 +1100
committerAdam Jackson <ajax@redhat.com>2008-02-14 07:52:02 +1100
commitf3b3b37ec6197f8884417fbc26630d3a28f2e319 (patch)
tree345a9462eea606d927f3007992c6830b0000e4bb /hw
parentb740b865e4c156a40adc6b63fcf215156fc9151a (diff)
Use strerror instead of errno values in user strings.
Diffstat (limited to 'hw')
-rw-r--r--hw/dmx/examples/ev.c2
-rw-r--r--hw/kdrive/linux/linux.c2
-rw-r--r--hw/kdrive/src/kmap.c8
-rw-r--r--hw/kdrive/vesa/vm86.c2
-rw-r--r--hw/vfb/InitOutput.c18
-rw-r--r--hw/xfree86/os-support/bsd/bsd_apm.c2
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kqueue_apm.c2
-rw-r--r--hw/xfree86/os-support/solaris/sun_apm.c6
-rw-r--r--hw/xprint/ps/psout_ftpstype1.c2
-rw-r--r--hw/xquartz/darwinKeyboard.c12
10 files changed, 28 insertions, 28 deletions
diff --git a/hw/dmx/examples/ev.c b/hw/dmx/examples/ev.c
index 10912266d..ba45c2b25 100644
--- a/hw/dmx/examples/ev.c
+++ b/hw/dmx/examples/ev.c
@@ -174,7 +174,7 @@ int main(int argc, char **argv)
}
printf("\n");
}
- printf("rc = %d, errno = %d (%s)\n", rc, errno, strerror(errno));
+ printf("rc = %d, (%s)\n", rc, strerror(errno));
close(fd);
}
}
diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c
index 23cd8f59f..258dc7b81 100644
--- a/hw/kdrive/linux/linux.c
+++ b/hw/kdrive/linux/linux.c
@@ -441,7 +441,7 @@ LinuxFini (void)
memset (&vts, '\0', sizeof (vts)); /* valgrind */
ioctl (fd, VT_GETSTATE, &vts);
if (ioctl (fd, VT_DISALLOCATE, vtno) < 0)
- fprintf (stderr, "Can't deallocate console %d errno %d\n", vtno, errno);
+ fprintf (stderr, "Can't deallocate console %d %s\n", vtno, strerror(errno));
close (fd);
}
return;
diff --git a/hw/kdrive/src/kmap.c b/hw/kdrive/src/kmap.c
index b92c1a84f..ce1e28ae4 100644
--- a/hw/kdrive/src/kmap.c
+++ b/hw/kdrive/src/kmap.c
@@ -132,8 +132,8 @@ KdSetMappedMode (CARD32 addr, CARD32 size, int mode)
sentry.type = type;
if (ioctl (mtrr, MTRRIOC_ADD_ENTRY, &sentry) < 0)
- ErrorF ("MTRRIOC_ADD_ENTRY failed 0x%x 0x%x %d (errno %d)\n",
- base, bound - base, type, errno);
+ ErrorF ("MTRRIOC_ADD_ENTRY failed 0x%x 0x%x %d (%s)\n",
+ base, bound - base, type, strerror(errno));
}
#endif
}
@@ -171,8 +171,8 @@ KdResetMappedMode (CARD32 addr, CARD32 size, int mode)
sentry.type = type;
if (ioctl (mtrr, MTRRIOC_DEL_ENTRY, &sentry) < 0)
- ErrorF ("MTRRIOC_DEL_ENTRY failed 0x%x 0x%x %d (errno %d)\n",
- base, bound - base, type, errno);
+ ErrorF ("MTRRIOC_DEL_ENTRY failed 0x%x 0x%x %d (%s)\n",
+ base, bound - base, type, strerror(errno));
}
#endif
}
diff --git a/hw/kdrive/vesa/vm86.c b/hw/kdrive/vesa/vm86.c
index 78fc593a7..0f7bb2262 100644
--- a/hw/kdrive/vesa/vm86.c
+++ b/hw/kdrive/vesa/vm86.c
@@ -567,7 +567,7 @@ vm86_loop(Vm86InfoPtr vi)
if(errno == ENOSYS) {
ErrorF("No vm86 support. Are you running on AMD64?\n");
} else {
- ErrorF("vm86 failed (errno = %d).\n", errno);
+ ErrorF("vm86 failed (%s).\n", strerror(errno));
Vm86Debug(vi);
}
} else {
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index a00f7a5bb..1edceb930 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -179,8 +179,8 @@ ddxGiveUp()
if (-1 == unlink(vfbScreens[i].mmap_file))
{
perror("unlink");
- ErrorF("unlink %s failed, errno %d",
- vfbScreens[i].mmap_file, errno);
+ ErrorF("unlink %s failed, %s",
+ vfbScreens[i].mmap_file, strerror(errno));
}
}
break;
@@ -196,7 +196,7 @@ ddxGiveUp()
if (-1 == shmdt((char *)vfbScreens[i].pXWDHeader))
{
perror("shmdt");
- ErrorF("shmdt failed, errno %d", errno);
+ ErrorF("shmdt failed, %s", strerror(errno));
}
}
break;
@@ -582,7 +582,7 @@ vfbBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
#endif
{
perror("msync");
- ErrorF("msync failed, errno %d", errno);
+ ErrorF("msync failed, %s", strerror(errno));
}
}
}
@@ -605,7 +605,7 @@ vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb)
if (-1 == (pvfb->mmap_fd = open(pvfb->mmap_file, O_CREAT|O_RDWR, 0666)))
{
perror("open");
- ErrorF("open %s failed, errno %d", pvfb->mmap_file, errno);
+ ErrorF("open %s failed, %s", pvfb->mmap_file, strerror(errno));
return;
}
@@ -621,7 +621,7 @@ vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb)
if (-1 == write(pvfb->mmap_fd, dummyBuffer, writeThisTime))
{
perror("write");
- ErrorF("write %s failed, errno %d", pvfb->mmap_file, errno);
+ ErrorF("write %s failed, %s", pvfb->mmap_file, strerror(errno));
return;
}
}
@@ -635,7 +635,7 @@ vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb)
if (-1 == (long)pvfb->pXWDHeader)
{
perror("mmap");
- ErrorF("mmap %s failed, errno %d", pvfb->mmap_file, errno);
+ ErrorF("mmap %s failed, %s", pvfb->mmap_file, strerror(errno));
pvfb->pXWDHeader = NULL;
return;
}
@@ -659,7 +659,7 @@ vfbAllocateSharedMemoryFramebuffer(vfbScreenInfoPtr pvfb)
if (pvfb->shmid < 0)
{
perror("shmget");
- ErrorF("shmget %d bytes failed, errno %d", pvfb->sizeInBytes, errno);
+ ErrorF("shmget %d bytes failed, %s", pvfb->sizeInBytes, strerror(errno));
return;
}
@@ -669,7 +669,7 @@ vfbAllocateSharedMemoryFramebuffer(vfbScreenInfoPtr pvfb)
if (-1 == (long)pvfb->pXWDHeader)
{
perror("shmat");
- ErrorF("shmat failed, errno %d", errno);
+ ErrorF("shmat failed, %s", strerror(errno));
pvfb->pXWDHeader = NULL;
return;
}
diff --git a/hw/xfree86/os-support/bsd/bsd_apm.c b/hw/xfree86/os-support/bsd/bsd_apm.c
index 61779875c..43eda7421 100644
--- a/hw/xfree86/os-support/bsd/bsd_apm.c
+++ b/hw/xfree86/os-support/bsd/bsd_apm.c
@@ -66,7 +66,7 @@ bsdPMGetEventFromOS(int fd, pmEvent *events, int num)
if (ioctl(fd, APM_IOC_NEXTEVENT, &bsdEvent) < 0) {
if (errno != EAGAIN) {
xf86Msg(X_WARNING, "bsdPMGetEventFromOS: APM_IOC_NEXTEVENT"
- " errno = %d\n", errno);
+ " %s\n", strerror(errno));
}
break;
}
diff --git a/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c b/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
index b0171e2c3..b37070c37 100644
--- a/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
+++ b/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
@@ -102,7 +102,7 @@ bsdPMGetEventFromOS(int kq, pmEvent *events, int num)
break;
} else if (result < 0) {
xf86Msg(X_WARNING, "bsdPMGetEventFromOS: kevent returns"
- " errno = %d\n", errno);
+ " %s\n", strerror(errno));
break;
}
events[i] = bsdToXF86(APM_EVENT_TYPE(ev.data));
diff --git a/hw/xfree86/os-support/solaris/sun_apm.c b/hw/xfree86/os-support/solaris/sun_apm.c
index a9657fd55..7decc900f 100644
--- a/hw/xfree86/os-support/solaris/sun_apm.c
+++ b/hw/xfree86/os-support/solaris/sun_apm.c
@@ -149,7 +149,7 @@ sunPMGetEventFromOS(int fd, pmEvent *events, int num)
if (ioctl(fd, APM_IOC_NEXTEVENT, &sunEvent) < 0) {
if (errno != EAGAIN) {
xf86Msg(X_WARNING, "sunPMGetEventFromOS: APM_IOC_NEXTEVENT"
- " errno = %d\n", errno);
+ " %s\n", strerror(errno));
}
break;
}
@@ -178,7 +178,7 @@ sunPMConfirmEventToOs(int fd, pmEvent event)
return PM_CONTINUE;
else {
xf86Msg(X_WARNING, "sunPMConfirmEventToOs: APM_IOC_SUSPEND"
- " errno = %d\n", errno);
+ " %s\n", strerror(errno));
return PM_FAILED;
}
case XF86_APM_STANDBY_RESUME:
@@ -191,7 +191,7 @@ sunPMConfirmEventToOs(int fd, pmEvent event)
return PM_CONTINUE;
else {
xf86Msg(X_WARNING, "sunPMConfirmEventToOs: APM_IOC_RESUME"
- " errno = %d\n", errno);
+ " %s\n", strerror(errno));
return PM_FAILED;
}
default:
diff --git a/hw/xprint/ps/psout_ftpstype1.c b/hw/xprint/ps/psout_ftpstype1.c
index 2d40c186a..572e13601 100644
--- a/hw/xprint/ps/psout_ftpstype1.c
+++ b/hw/xprint/ps/psout_ftpstype1.c
@@ -124,7 +124,7 @@ int PsOut_DownloadFreeType1(PsOutPtr self, const char *psfontname, FontPtr pFont
switch(childpid)
{
case -1:
- FatalError("PS DDX internal error: Cannot fork() converter child process, errno=%d\n", (int)errno);
+ FatalError("PS DDX internal error: Cannot fork() converter child process, %s\n", strerror(errno));
break;
case 0: /* child */
fclose(self->Fp);
diff --git a/hw/xquartz/darwinKeyboard.c b/hw/xquartz/darwinKeyboard.c
index b368fe9d9..8d1ee8ec9 100644
--- a/hw/xquartz/darwinKeyboard.c
+++ b/hw/xquartz/darwinKeyboard.c
@@ -344,13 +344,13 @@ static Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
fref = fopen( darwinKeymapFile, "rb" );
if (fref == NULL) {
- ErrorF("Unable to open keymapping file '%s' (errno %d).\n",
- darwinKeymapFile, errno);
+ ErrorF("Unable to open keymapping file '%s' (%s).\n",
+ darwinKeymapFile, strerror(errno));
return FALSE;
}
if (fstat(fileno(fref), &st) == -1) {
- ErrorF("Could not stat keymapping file '%s' (errno %d).\n",
- darwinKeymapFile, errno);
+ ErrorF("Could not stat keymapping file '%s' (%s).\n",
+ darwinKeymapFile, strerror(errno));
return FALSE;
}
@@ -364,8 +364,8 @@ static Bool DarwinReadKeymapFile(NXKeyMapping *keyMap) {
inBuffer = (char*) xalloc( st.st_size );
bufferEnd = (int *) (inBuffer + st.st_size);
if (fread(inBuffer, st.st_size, 1, fref) != 1) {
- ErrorF("Could not read %qd bytes from keymapping file '%s' (errno %d).\n",
- st.st_size, darwinKeymapFile, errno);
+ ErrorF("Could not read %qd bytes from keymapping file '%s' (%s).\n",
+ st.st_size, darwinKeymapFile, strerror(errno));
return FALSE;
}