From fee17b3562f739225ed7e25a4ccb9684eb0de48c Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Fri, 25 Feb 2011 22:28:57 +0000 Subject: [PATCH] * callback.c (fdbad): Return EBADF rather than EINVAL for bad file descriptors. --- sim/common/ChangeLog | 5 +++++ sim/common/callback.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 11f1d34c9a9..b88fc325737 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +2011-02-25 Kevin Buettner + + * callback.c (fdbad): Return EBADF rather than EINVAL for bad + file descriptors. + 2011-02-14 Mike Frysinger * hw-alloc.c (hw_alloc_data): Delete zalloc_p. diff --git a/sim/common/callback.c b/sim/common/callback.c index 8f8aa9c804d..f811304a549 100644 --- a/sim/common/callback.c +++ b/sim/common/callback.c @@ -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; -- 2.30.2