This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Use EBADF, not EINVAL, for bad file descriptors in sim/common/callback.c


I've just committed the patch below.  (I think it's reasonably obvious.)

It fixes some gdb.base/fileio.exp failures when testing against the
v850 sim.

I have some more patches on the way (less obvious) which improve the
fileio.exp results even more.

Kevin

In sim/common:

	* callback.c (fdbad): Return EBADF rather than EINVAL for bad
	file descriptors.

Index: sim/common/callback.c
===================================================================
RCS file: /cvs/src/src/sim/common/callback.c,v
retrieving revision 1.28
diff -u -p -r1.28 callback.c
--- sim/common/callback.c	1 Jan 2011 15:33:55 -0000	1.28
+++ sim/common/callback.c	25 Feb 2011 22:04:07 -0000
@@ -121,7 +121,7 @@ fdbad (p, fd)
 {
   if (fd < 0 || fd > MAX_CALLBACK_FDS || p->fd_buddy[fd] < 0)
     {
-      p->last_errno = EINVAL;
+      p->last_errno = EBADF;
       return -1;
     }
   return 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]