Merge pull request #669 from alexrp/errno

Use errno instead of getErrno in Phobos.
This commit is contained in:
Andrei Alexandrescu 2012-07-08 18:31:55 -07:00
commit 0b4df6a57b
4 changed files with 8 additions and 8 deletions

View file

@ -883,7 +883,7 @@ class ErrnoException : Exception
uint errno; // operating system error code uint errno; // operating system error code
this(string msg, string file = null, size_t line = 0) this(string msg, string file = null, size_t line = 0)
{ {
errno = getErrno(); errno = .errno();
version (linux) version (linux)
{ {
char[1024] buf = void; char[1024] buf = void;

View file

@ -212,7 +212,7 @@ class FileException : Exception
/++ /++
Constructor which takes the error number ($(LUCKY GetLastError) Constructor which takes the error number ($(LUCKY GetLastError)
in Windows, $(D_PARAM getErrno) in Posix). in Windows, $(D_PARAM errno) in Posix).
Params: Params:
name = Name of file for which the error occurred. name = Name of file for which the error occurred.
@ -229,7 +229,7 @@ class FileException : Exception
this.errno = errno; this.errno = errno;
} }
else version(Posix) this(in char[] name, else version(Posix) this(in char[] name,
uint errno = .getErrno(), uint errno = .errno,
string file = __FILE__, string file = __FILE__,
size_t line = __LINE__) size_t line = __LINE__)
{ {
@ -249,7 +249,7 @@ private T cenforce(T)(T condition, lazy const(char)[] name, string file = __FILE
} }
else version (Posix) else version (Posix)
{ {
throw new FileException(name, .getErrno(), file, line); throw new FileException(name, .errno, file, line);
} }
} }
return condition; return condition;

View file

@ -319,7 +319,7 @@ class MmFile
struct_stat64 statbuf; struct_stat64 statbuf;
if (fstat64(fd, &statbuf)) if (fstat64(fd, &statbuf))
{ {
//printf("\tfstat error, errno = %d\n",getErrno()); //printf("\tfstat error, errno = %d\n", errno);
.close(fd); .close(fd);
errnoEnforce(false, "Could not stat file "~filename); errnoEnforce(false, "Could not stat file "~filename);
} }
@ -586,7 +586,7 @@ private:
// } // }
// else version (linux) // else version (linux)
// { // {
// throw new FileException(filename, getErrno()); // throw new FileException(filename, errno);
// } // }
// else // else
// { // {

View file

@ -2262,7 +2262,7 @@ class StdioException : Exception
/** /**
Initialize with a message and an error code. */ Initialize with a message and an error code. */
this(string message, uint e = .getErrno()) this(string message, uint e = .errno)
{ {
errno = e; errno = e;
version (Posix) version (Posix)
@ -2295,7 +2295,7 @@ Initialize with a message and an error code. */
/// ditto /// ditto
static void opCall() static void opCall()
{ {
throw new StdioException(null, .getErrno()); throw new StdioException(null, .errno);
} }
} }