mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 13:40:20 +03:00
Merge pull request #669 from alexrp/errno
Use errno instead of getErrno in Phobos.
This commit is contained in:
commit
0b4df6a57b
4 changed files with 8 additions and 8 deletions
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
@ -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__)
|
||||
{
|
||||
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
@ -586,7 +586,7 @@ private:
|
|||
// }
|
||||
// else version (linux)
|
||||
// {
|
||||
// throw new FileException(filename, getErrno());
|
||||
// throw new FileException(filename, errno);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
|
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue