mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-06-10 03:01:34 -04:00
formatting: add .clang-format
This commit is contained in:
parent
a2d03cf618
commit
1feb41da8e
6 changed files with 415 additions and 294 deletions
14
util.c
14
util.c
|
|
@ -1,21 +1,22 @@
|
|||
/* See LICENSE.dwm file for copyright and license details. */
|
||||
#include "util.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
void
|
||||
die(const char *fmt, ...) {
|
||||
die(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
|
||||
if (fmt[0] && fmt[strlen(fmt) - 1] == ':') {
|
||||
fputc(' ', stderr);
|
||||
perror(NULL);
|
||||
} else {
|
||||
|
|
@ -36,7 +37,8 @@ ecalloc(size_t nmemb, size_t size)
|
|||
}
|
||||
|
||||
int
|
||||
fd_set_nonblock(int fd) {
|
||||
fd_set_nonblock(int fd)
|
||||
{
|
||||
int flags = fcntl(fd, F_GETFL);
|
||||
if (flags < 0) {
|
||||
perror("fcntl(F_GETFL):");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue