Skip to content

Commit

Permalink
Merge pull request #669 from alexrp/errno
Browse files Browse the repository at this point in the history
Use errno instead of getErrno in Phobos.
  • Loading branch information
andralex committed Jul 9, 2012
2 parents cade302 + adcac57 commit 0b4df6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion std/exception.d
Expand Up @@ -883,7 +883,7 @@ class ErrnoException : Exception
uint errno; // operating system error code
this(string msg, string file = null, size_t line = 0)
{
errno = getErrno();
errno = .errno();
version (linux)
{
char[1024] buf = void;
Expand Down
6 changes: 3 additions & 3 deletions std/file.d
Expand Up @@ -212,7 +212,7 @@ class FileException : Exception

/++
Constructor which takes the error number ($(LUCKY GetLastError)
in Windows, $(D_PARAM getErrno) in Posix).
in Windows, $(D_PARAM errno) in Posix).
Params:
name = Name of file for which the error occurred.
Expand All @@ -229,7 +229,7 @@ class FileException : Exception
this.errno = errno;
}
else version(Posix) this(in char[] name,
uint errno = .getErrno(),
uint errno = .errno,
string file = __FILE__,
size_t line = __LINE__)
{
Expand All @@ -249,7 +249,7 @@ private T cenforce(T)(T condition, lazy const(char)[] name, string file = __FILE
}
else version (Posix)
{
throw new FileException(name, .getErrno(), file, line);
throw new FileException(name, .errno, file, line);
}
}
return condition;
Expand Down
4 changes: 2 additions & 2 deletions std/mmfile.d
Expand Up @@ -319,7 +319,7 @@ class MmFile
struct_stat64 statbuf;
if (fstat64(fd, &statbuf))
{
//printf("\tfstat error, errno = %d\n",getErrno());
//printf("\tfstat error, errno = %d\n", errno);
.close(fd);
errnoEnforce(false, "Could not stat file "~filename);
}
Expand Down Expand Up @@ -586,7 +586,7 @@ private:
// }
// else version (linux)
// {
// throw new FileException(filename, getErrno());
// throw new FileException(filename, errno);
// }
// else
// {
Expand Down
4 changes: 2 additions & 2 deletions std/stdio.d
Expand Up @@ -2262,7 +2262,7 @@ class StdioException : Exception

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

Expand Down

0 comments on commit 0b4df6a

Please sign in to comment.