diff options
author | darylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-10-03 18:54:12 +0000 |
---|---|---|
committer | darylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-10-03 18:54:12 +0000 |
commit | 41b152c5f6ec3a5a6e51b4f8f0f90291a5895edc (patch) | |
tree | db28131d5929a4805654a802b64cc0d980b9559e /StdLib/LibC/Uefi | |
parent | 58081f2c64fbc2f89ac5a9b47b2643c280bc8f99 (diff) | |
download | edk2-platforms-41b152c5f6ec3a5a6e51b4f8f0f90291a5895edc.tar.xz |
StdLib: Improve robustness of stat() and make basename() a public function.
AppPkg: Refinements to pyconfig.h and port of getpath.c to EDK II.
Signed-off-by: darylm503
Reviewed-by: geekboy15a
Reviewed-by: jljusten
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12508 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/LibC/Uefi')
-rw-r--r-- | StdLib/LibC/Uefi/Devices/UefiShell/daShell.c | 4 | ||||
-rw-r--r-- | StdLib/LibC/Uefi/SysCalls.c | 2 | ||||
-rw-r--r-- | StdLib/LibC/Uefi/compat.c | 5 |
3 files changed, 4 insertions, 7 deletions
diff --git a/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c b/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c index d0abb8dd5b..de14ef31c5 100644 --- a/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c +++ b/StdLib/LibC/Uefi/Devices/UefiShell/daShell.c @@ -304,14 +304,14 @@ da_ShellStat( }
else {
Status = RETURN_DEVICE_ERROR;
+ errno = EIO;
}
- errno = EFI2errno(Status);
EFIerrno = Status;
if(FileInfo != NULL) {
FreePool(FileInfo); // Release the buffer allocated by the GetInfo function
}
- return errno? -1 : 0;
+ return (Status == RETURN_SUCCESS)? 0 : -1;
}
static
diff --git a/StdLib/LibC/Uefi/SysCalls.c b/StdLib/LibC/Uefi/SysCalls.c index d52249b58b..b5079e2c3a 100644 --- a/StdLib/LibC/Uefi/SysCalls.c +++ b/StdLib/LibC/Uefi/SysCalls.c @@ -923,7 +923,7 @@ fstat (int fd, struct stat *statbuf) identify the error.
**/
int
-stat (const char *path, void *statbuf)
+stat (const char *path, struct stat *statbuf)
{
int fd;
int retval = -1;
diff --git a/StdLib/LibC/Uefi/compat.c b/StdLib/LibC/Uefi/compat.c index 7f250d15ff..8ce4783a6a 100644 --- a/StdLib/LibC/Uefi/compat.c +++ b/StdLib/LibC/Uefi/compat.c @@ -94,6 +94,7 @@ #include <LibConfig.h>
#include <string.h>
#include <fcntl.h>
+#include <sys/syslimits.h>
#ifndef HAVE_GETOPT
char *optarg;
@@ -138,11 +139,7 @@ getopt(int argc, char **argv, char *args) }
#endif
-#ifdef WIN32
#define ISPATHSEPARATOR(x) ((x == '/') || (x == '\\'))
-#else
-#define ISPATHSEPARATOR(x) (x == '/')
-#endif
#ifndef HAVE_BASENAME
#ifndef PATH_MAX
|