From: Bradan Fleming Date: Sun, 1 Nov 2026 17:48:34 -0700 Subject: [PATCH] Fix build for Fedora The open() function needs to have flags set for O_CREAT, and CXXFLAGS shouldn't be overwritten. --- Makefile.linux | 4 ++-- crossapi.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.linux b/Makefile.linux index 020336b..d53d33c 100755 --- a/Makefile.linux +++ b/Makefile.linux @@ -1,7 +1,7 @@ -CXXFLAGS=-Wall -O2 +CXXFLAGS?=-Wall -O2 mp3val: main.o mpegparse.o out.o report.o crossapi.o crc.o - $(CXX) $(CXXFLAGS) $^ -o $@ + $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ clean: rm -f mp3val diff --git a/crossapi.cpp b/crossapi.cpp index cd8011a..0afaea3 100755 --- a/crossapi.cpp +++ b/crossapi.cpp @@ -241,7 +241,7 @@ int CrossAPI_MoveFile(char *szNewName,char *szOldName) { //Moving failed due to different logical drives of source and destination. Let's copy: id=open(szOldName,O_RDONLY); if(id==-1) return 0; - od=open(szNewName,O_WRONLY|O_CREAT|O_TRUNC); + od=open(szNewName,O_WRONLY|O_CREAT|O_TRUNC,0644); if(od==-1) { close(id); return 0; @@ -279,7 +279,7 @@ int CrossAPI_OpenFile(char *szFileName,bool create,bool write) { if(create) flags|=(O_CREAT|O_TRUNC); if(write) flags|=O_WRONLY; else flags|=O_RDONLY; - return open(szFileName,flags); + return open(szFileName,flags,0644); } int CrossAPI_SetFilePointer(int iHandle,int iPointer,bool bFromCurrent) { -- 2.56.0