io, net, evnet: quote file names in error messages
This commit is contained in:
parent
b3a31b69ee
commit
1e4bf90c60
|
@ -46,7 +46,7 @@ InotifyEvent::AddWatch(const char *pathname, uint32_t mask)
|
||||||
{
|
{
|
||||||
int wd = TryAddWatch(pathname, mask);
|
int wd = TryAddWatch(pathname, mask);
|
||||||
if (wd < 0)
|
if (wd < 0)
|
||||||
throw FmtErrno("inotify_add_watch('{}') failed", pathname);
|
throw FmtErrno("inotify_add_watch({:?}) failed", pathname);
|
||||||
|
|
||||||
return wd;
|
return wd;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ OpenReadOnly(const char *path, int flags)
|
||||||
{
|
{
|
||||||
UniqueFileDescriptor fd;
|
UniqueFileDescriptor fd;
|
||||||
if (!fd.Open(path, O_RDONLY|flags))
|
if (!fd.Open(path, O_RDONLY|flags))
|
||||||
throw FmtErrno("Failed to open '{}'", path);
|
throw FmtErrno("Failed to open {:?}", path);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ OpenWriteOnly(const char *path, int flags)
|
||||||
{
|
{
|
||||||
UniqueFileDescriptor fd;
|
UniqueFileDescriptor fd;
|
||||||
if (!fd.Open(path, O_WRONLY|flags))
|
if (!fd.Open(path, O_WRONLY|flags))
|
||||||
throw FmtErrno("Failed to open '{}'", path);
|
throw FmtErrno("Failed to open {:?}", path);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ OpenDirectory(const char *path, int flags)
|
||||||
{
|
{
|
||||||
UniqueFileDescriptor fd;
|
UniqueFileDescriptor fd;
|
||||||
if (!fd.Open(path, O_DIRECTORY|O_RDONLY|flags))
|
if (!fd.Open(path, O_DIRECTORY|O_RDONLY|flags))
|
||||||
throw FmtErrno("Failed to open '{}'", path);
|
throw FmtErrno("Failed to open {:?}", path);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ OpenPath(const char *path, int flags)
|
||||||
{
|
{
|
||||||
UniqueFileDescriptor fd;
|
UniqueFileDescriptor fd;
|
||||||
if (!fd.Open(path, O_PATH|flags))
|
if (!fd.Open(path, O_PATH|flags))
|
||||||
throw FmtErrno("Failed to open '{}'", path);
|
throw FmtErrno("Failed to open {:?}", path);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ OpenPath(FileDescriptor directory, const char *name, int flags)
|
||||||
{
|
{
|
||||||
UniqueFileDescriptor fd;
|
UniqueFileDescriptor fd;
|
||||||
if (!fd.Open(directory, name, O_PATH|flags))
|
if (!fd.Open(directory, name, O_PATH|flags))
|
||||||
throw FmtErrno("Failed to open '{}'", name);
|
throw FmtErrno("Failed to open {:?}", name);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ OpenReadOnly(FileDescriptor directory, const char *name, int flags)
|
||||||
{
|
{
|
||||||
UniqueFileDescriptor fd;
|
UniqueFileDescriptor fd;
|
||||||
if (!fd.Open(directory, name, O_RDONLY|flags))
|
if (!fd.Open(directory, name, O_RDONLY|flags))
|
||||||
throw FmtErrno("Failed to open '{}'", name);
|
throw FmtErrno("Failed to open {:?}", name);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ OpenWriteOnly(FileDescriptor directory, const char *name, int flags)
|
||||||
{
|
{
|
||||||
UniqueFileDescriptor fd;
|
UniqueFileDescriptor fd;
|
||||||
if (!fd.Open(directory, name, O_WRONLY|flags))
|
if (!fd.Open(directory, name, O_WRONLY|flags))
|
||||||
throw FmtErrno("Failed to open '{}'", name);
|
throw FmtErrno("Failed to open {:?}", name);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ OpenDirectory(FileDescriptor directory, const char *name, int flags)
|
||||||
{
|
{
|
||||||
UniqueFileDescriptor fd;
|
UniqueFileDescriptor fd;
|
||||||
if (!fd.Open(directory, name, O_DIRECTORY|O_RDONLY|flags))
|
if (!fd.Open(directory, name, O_DIRECTORY|O_RDONLY|flags))
|
||||||
throw FmtErrno("Failed to open '{}'", name);
|
throw FmtErrno("Failed to open {:?}", name);
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ Resolve(const char *node, const char *service,
|
||||||
#else
|
#else
|
||||||
const char *msg = gai_strerror(error);
|
const char *msg = gai_strerror(error);
|
||||||
#endif
|
#endif
|
||||||
throw FmtRuntimeError("Failed to resolve '{}':'{}': {}",
|
throw FmtRuntimeError("Failed to resolve {:?}:{:?}: {}",
|
||||||
node == nullptr ? "" : node,
|
node == nullptr ? "" : node,
|
||||||
service == nullptr ? "" : service,
|
service == nullptr ? "" : service,
|
||||||
msg);
|
msg);
|
||||||
|
|
Loading…
Reference in New Issue