mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
don't return an object if there is no error
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35186 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
52e900d07c
commit
ade0036037
1 changed files with 6 additions and 2 deletions
|
@ -100,8 +100,8 @@ strerror_r(int eno, char *buf, int len)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/* Returns an NSError instance encapsulating the last system error,
|
||||||
* Returns an NSError instance encapsulating the last system error.
|
* or nil if the last system call did not result in an error.
|
||||||
* The user info dictionary of this object will be mutable, so that
|
* The user info dictionary of this object will be mutable, so that
|
||||||
* additional information can be placed in it by higher level code.
|
* additional information can be placed in it by higher level code.
|
||||||
*/
|
*/
|
||||||
|
@ -114,6 +114,10 @@ strerror_r(int eno, char *buf, int len)
|
||||||
#else
|
#else
|
||||||
eno = errno;
|
eno = errno;
|
||||||
#endif
|
#endif
|
||||||
|
if (0 == eno)
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
return [self _systemError: eno];
|
return [self _systemError: eno];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue