Compare commits

...

5 Commits

Author SHA1 Message Date
Oktay Imanzade 3483d27641
Merge be03c21a84 into 5853ac8e48 2024-04-06 00:57:02 +04:00
Arun 5853ac8e48
Merge pull request #1864 from horrad/master
Fix file creation on OpenBSD
2024-04-05 23:31:08 +05:30
Martin Ziemer 28d993a8e8 Fix file creation on OpenBSD
On OpenBSD at least one of O_RDONLY, O_WRONLY or O_RDWR is needed to open a file.

In creating a new file none of those is set, which leads to an EINVAL error ("invalid argument").

Since the new file is only created and never read, I chose to use O_WRONLY.
2024-04-04 15:57:36 +02:00
Arun 22aa1455a6
Merge pull request #1861 from KlzXS/makefile_icons
Prevent multiple icons options being selected at the same time
2024-03-30 01:33:20 +05:30
KlzXS 7806d5d371
Prevent multiple icons options being selected at the same time 2024-03-28 18:20:21 +01:00
2 changed files with 15 additions and 1 deletions

View File

@ -36,6 +36,8 @@ O_GITSTATUS := 0 # add git status to detail view
O_NAMEFIRST := 0 # print file name first, add uid and guid to detail view
O_RESTOREPREVIEW := 0 # add preview pipe to close and restore preview pane
T_ICONS := 0 # test if multiple icons options are set and fail
# convert targets to flags for backwards compatibility
ifneq ($(filter debug,$(MAKECMDGOALS)),)
O_DEBUG := 1
@ -97,16 +99,28 @@ endif
ifeq ($(strip $(O_ICONS)),1)
ICONS_INCLUDE = icons-generated-icons-in-term.h
CPPFLAGS += -DICONS_IN_TERM -DICONS_INCLUDE=\"$(ICONS_INCLUDE)\"
ifeq ($(strip $(T_ICONS)),1)
$(error Choose only one system for icons (O_ICONS, O_NERD or O_EMOJI))
endif
T_ICONS := 1
endif
ifeq ($(strip $(O_NERD)),1)
ICONS_INCLUDE = icons-generated-nerd.h
CPPFLAGS += -DNERD -DICONS_INCLUDE=\"$(ICONS_INCLUDE)\"
ifeq ($(strip $(T_ICONS)),1)
$(error Choose only one system for icons (O_ICONS, O_NERD or O_EMOJI))
endif
T_ICONS := 1
endif
ifeq ($(strip $(O_EMOJI)),1)
ICONS_INCLUDE = icons-generated-emoji.h
CPPFLAGS += -DEMOJI -DICONS_INCLUDE=\"$(ICONS_INCLUDE)\"
ifeq ($(strip $(T_ICONS)),1)
$(error Choose only one system for icons (O_ICONS, O_NERD or O_EMOJI))
endif
T_ICONS := 1
endif
ifeq ($(strip $(O_QSORT)),1)

View File

@ -4732,7 +4732,7 @@ next:
return FALSE;
}
} else {
int fd = open(path, O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR); /* Forced create mode for files */
int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR); /* Forced create mode for files */
if (fd == -1 && errno != EEXIST) {
DPRINTF_S("open!");