mirror of
https://github.com/NixOS/nix.git
synced 2025-11-10 04:26:01 +01:00
Apply clang-format universally.
* It is tough to contribute to a project that doesn't use a formatter, * It is extra hard to contribute to a project which has configured the formatter, but ignores it for some files * Code formatting makes it harder to hide obscure / weird bugs by accident or on purpose, Let's rip the bandaid off? Note that PRs currently in flight should be able to be merged relatively easily by applying `clang-format` to their tip prior to merge.
This commit is contained in:
parent
41bf87ec70
commit
e4f62e4608
587 changed files with 23258 additions and 23135 deletions
|
|
@ -3,12 +3,12 @@
|
|||
#include "nix/util/util.hh"
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <winsock2.h>
|
||||
# include <afunix.h>
|
||||
# include <winsock2.h>
|
||||
# include <afunix.h>
|
||||
#else
|
||||
# include <sys/socket.h>
|
||||
# include <sys/un.h>
|
||||
# include "nix/util/processes.hh"
|
||||
# include <sys/socket.h>
|
||||
# include <sys/un.h>
|
||||
# include "nix/util/processes.hh"
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
|
|
@ -16,11 +16,14 @@ namespace nix {
|
|||
|
||||
AutoCloseFD createUnixDomainSocket()
|
||||
{
|
||||
AutoCloseFD fdSocket = toDescriptor(socket(PF_UNIX, SOCK_STREAM
|
||||
#ifdef SOCK_CLOEXEC
|
||||
| SOCK_CLOEXEC
|
||||
#endif
|
||||
, 0));
|
||||
AutoCloseFD fdSocket = toDescriptor(socket(
|
||||
PF_UNIX,
|
||||
SOCK_STREAM
|
||||
#ifdef SOCK_CLOEXEC
|
||||
| SOCK_CLOEXEC
|
||||
#endif
|
||||
,
|
||||
0));
|
||||
if (!fdSocket)
|
||||
throw SysError("cannot create Unix domain socket");
|
||||
#ifndef _WIN32
|
||||
|
|
@ -44,9 +47,8 @@ AutoCloseFD createUnixDomainSocket(const Path & path, mode_t mode)
|
|||
return fdSocket;
|
||||
}
|
||||
|
||||
static void bindConnectProcHelper(
|
||||
std::string_view operationName, auto && operation,
|
||||
Socket fd, const std::string & path)
|
||||
static void
|
||||
bindConnectProcHelper(std::string_view operationName, auto && operation, Socket fd, const std::string & path)
|
||||
{
|
||||
struct sockaddr_un addr;
|
||||
addr.sun_family = AF_UNIX;
|
||||
|
|
@ -118,4 +120,4 @@ AutoCloseFD connect(const std::filesystem::path & path)
|
|||
return fd;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue