search for: o_binary

Displaying 20 results from an estimated 42 matches for "o_binary".

2013 Jun 27
2
[PATCH] hivex: Add O_BINARY flag to open calls for platforms where this isn't the default (such as Win32)
...lu (sorry for advertising but I couldn't resist ;-))) is evolving, I recently added write support to it. While under Linux everything worked nice, the Windblows build didn't. It seems that Windows opens files by default in text mode (O_TEXT) which is a problem. The attached patch adds the O_BINARY flag to all open calls which solves the issue and allows libhivex to alter hives in Windows. I don't think this will harm on any other platform, so no fancy ifdefs this time :) ok? cu -- Unix _IS_ user friendly - it's just selective about who its friends are!
2013 Jun 28
0
Re: [PATCH] hivex: Add O_BINARY flag to open calls for platforms where this isn't the default (such as Win32)
...I couldn't resist > ;-))) is evolving, I recently added write support to it. > > While under Linux everything worked nice, the Windblows build didn't. > > It seems that Windows opens files by default in text mode (O_TEXT) which > is a problem. The attached patch adds the O_BINARY flag to all open > calls which solves the issue and allows libhivex to alter hives in Windows. > > I don't think this will harm on any other platform, so no fancy ifdefs > this time :) > > ok? > > cu > > -- > Unix _IS_ user friendly - it's just > sel...
2003 Mar 04
1
2.5.6 needs following fix on WinNTs
Hi, Here is the problem (syscall.c, function do_open) on NT, Win2K, WinXP, with stripped "/" for UNC path convention, detected in release 2.5.5, 2.5.6: int do_open(char *pathname, int flags, mode_t mode) { if (flags != O_RDONLY) { if (dry_run) return -1; CHECK_RO } #ifdef O_BINARY /* for Windows */ flags |= O_BINARY; #endif /* some systems can't handle a double / */ if (pathname[0] == '/' && pathname[1] == '/') pathname++; return open(pathname, flags, mode); } I suggest the following fix, allowing files to be open even on WinNTs, if UNC pa...
2011 Jun 28
0
[PATCH] cpio: cleanup O_BINARY usage.
...ax at stro.at> --- usr/utils/cpio.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/usr/utils/cpio.c b/usr/utils/cpio.c index 6891883..15134b9 100644 --- a/usr/utils/cpio.c +++ b/usr/utils/cpio.c @@ -31,10 +31,6 @@ #include <fnmatch.h> #endif -#ifndef O_BINARY -# define O_BINARY 0 -#endif - # ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' # endif @@ -576,8 +572,7 @@ static void create_final_defers(void) if (link_res == 0) { continue; } - out_file_des = open(d->header.c_name, - O_CREAT | O_WRONLY | O_BINARY, 0...
2000 Aug 01
2
Port of OpenSSH-2.1.1p4 to Cygwin
...========= - Makefile.in: Changed to support $EXEEXT transparently. aux.o renamed to aux_funcs.o in LIBSSH_OBJS. - acconfig.h: Add HAVE_CYGWIN. - auth-passwd.c: Support getting NT passwords via Cygwin special functions. Disable check for uid = 0 when compiled for Cygwin. - auth-skey.c: Add O_BINARY to open call. - auth1.c: Reject changing user context if not authenticated via password under Windows NT. Disable check for uid = 0 when compiled for Cygwin. - authfile.c: Add O_BINARY to open calls. Disable check for file modes when compiled for Cygwin. - bsd-daemon.c: Avoid possible r...
2003 Jan 26
1
[PATCH] open O_TEXT and O_BINARY for cygwin/windows
Ville Herva [mailto:vherva@niksula.hut.fi] wrote: > Of course, whether O_TEXT is defined or not does not > necessarily imply the availability of "t", but I > can't think of better alternative. Stratus VOS implements O_TEXT and O_BINARY but does not recognize "t". We have the options defined in ANS C and in POSIX. I'm at home and don't have my reference materials handy, but I think this is going to be a problem for us. I can see looking at the code that we will reject the open if we see unknown letters. Please...
2003 Jan 21
6
Please test rsync-2.5.6pre2
The second rsync-2.5.6 pre-release version is now available at: http://rsync.samba.org/ftp/rsync/preview/rsync-2.5.6pre2.tar.gz ftp://rsync.samba.org/pub/rsync/preview/rsync-2.5.6pre2.tar.gz rsync://rsync.samba.org/ftp/rsync/preview/rsync-2.5.6pre2.tar.gz There's also a corresponding '.sig' file that contains a gpg signature of the file; the public key is available on the
2017 Feb 09
1
[PATCH] Fix compile with cygwin
...98,7 +98,7 @@ #define FLAC__STRNCASECMP strncasecmp #endif -#if defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ || defined __EMX__ +#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__ #include <io.h> /* for _setmode(), chmod() */ #include <fcntl.h> /* for _O_BINARY */ #else diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 2e1fdd5..d3b6e03 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -1253,9 +1253,6 @@ FILE *get_binary_stdin_(void) */ #if defined _MSC_VER || defined __MINGW32__ _setmode(_f...
2001 Apr 02
1
[PATCH]: scp could hang in Cygwin
...= RCS file: /cvs/openssh_cvs/scp.c,v retrieving revision 1.66 diff -u -p -r1.66 scp.c --- scp.c 2001/03/29 00:43:54 1.66 +++ scp.c 2001/04/02 19:47:14 @@ -291,6 +291,9 @@ main(argc, argv) case 't': /* "to" */ iamremote = 1; tflag = 1; +#ifdef HAVE_CYGWIN + setmode (0, O_BINARY); +#endif break; default: usage(); Index: openbsd-compat/bsd-cygwin_util.c =================================================================== RCS file: /cvs/openssh_cvs/openbsd-compat/bsd-cygwin_util.c,v retrieving revision 1.3 diff -u -p -r1.3 bsd-cygwin_util.c --- openbsd-compat/bsd-c...
2002 Feb 20
2
[PATCH] rsync on cygwin - textmode config files
...ine rsync as well? (4) Lastly, the original reason I began compiling my own version was that I had a binary version that did not force binary open (I got corrupted .doc files etc in the transmission.) I found out that the mainline rsync source (as of 2.4.2) already has that O_BINARY bit in do_open, so no problem here. It works without, if you mount everything with -b (binary) in CYGWIN or force that with "set CYGWIN=BINMODE", but O_BINARY is the (most) correct way to do it -- it works regardless how the user has mounted his filesystems. H...
2004 Jan 30
1
rsync 2.6.0: possible sanitization bug?
...While merging the 2.6.0 changes into our modified version of rsync, I noticed the following bit of code in 2.6.0's options.c: extern int sanitize_paths; if (sanitize_paths) sanitize_path(strdup(files_from), NULL); filesfrom_fd = open(files_from, O_RDONLY|O_BINARY); Since sanitize_path modifies its first argument in place, the path that open() gets there hasn't been sanitized, which could be a security issue -- plus it leaks memory. Shouldn't that be something like this? extern int sanitize_paths; char *s = strdup(files_from);...
2006 Oct 30
0
File Store permissions
...;couldn''t create file %s: <%s>", path, strerror(errno)); } @@ -252,7 +252,7 @@ static OutStream *fs_new_output(Store *s { char path[MAX_FILE_PATH]; int fd = open(join_path(path, store->dir.path, filename), - O_WRONLY | O_CREAT | O_BINARY, S_IRUSR | S_IWUSR); + O_WRONLY | O_CREAT | O_BINARY, store->file_mode); OutStream *os; if (fd < 0) { RAISE(IO_ERROR, "couldn''t create OutStream %s: <%s>", @@ -431,9 +431,19 @@ static void fs_close_i(Store *store) static Store *fs...
2001 Feb 12
1
Little Bug under Win32
...z The problem is that stdout is opend as Text-File so every LF which comes from the SSH-Server (Unix) will be translated to CR LF on a Win32-Machine. The problem can be fixed by adding following line to the beginning of the clientloop-function: setmode(fileno(stdout), O_BINARY); Christian
2004 Sep 10
3
Cygwin patch
Building flac 1.0.3 under the latest cygwin craps out in src/libFLAC/file_decode.c and src/flac/file.c for _O_BINARY not being defined. It appears that #include <io.h> is not sufficient to pull in this macro; you need to #include <fcntl.h>. BTW, nice test suite! Talk about exhaustive. If anyone is interested in my Cygwin binaries (no Ogg support), I can provide an encap package file. Let me...
2010 Nov 19
3
File Offsets for SCP (patch)
...le ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q1246S:o:F:")) != -1) + while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q1246S:o:F:A:Z:")) != -1) switch (ch) { /* User-visible flags. */ case '1': @@ -407,6 +411,16 @@ main(int argc, char **argv) setmode(0, O_BINARY); #endif break; + case 'A': + fd_offset = strtod(optarg, &endp); + if (fd_offset < 0 || *endp != '\0') + usage(); + break; + case 'Z': + fd_inset = strtod(optarg, &endp); + if (fd_inset < 0 || *endp != '\0...
2004 Aug 06
1
some portability fixes ...
...quot; > THREADLIBS="" > else > 373a393,394 > fi # enable_mingw = yes > 86a87 > #include <errno.h> 2155a2157,2161 > } > else > { > // for those lamer systems that mingles text ... LIKAI > setmode( sourcecon->food.source->dumpfd, O_BINARY ); 454a455,459 > else > { > // for those systems that mingles text ... LIKAI > setmode( source->dumpfd, O_BINARY ); > } 40a41,43 > #ifdef _WIN32 > #include <win32config.h> > #else 41a45 > #endif --- >8 ---- List archives: http://www.xiph....
2002 Nov 01
0
File access from within a DLL
...de <stdio.h> #include <math.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> to read in a binary file. There are some system dependencies eg #ifdef Win32 fd = open(fname, O_RDONLY | O_BINARY); #else fd = open(fname, O_RDONLY); #endif but until recently this code worked fine under Win2k and Solaris. I recompiled the code after upgrading to V1.6 and the code still works fine under Solaris, but under W2k it fails for larger files. First thought there was a problem with the compiler...
2005 Feb 26
1
[patch] fixes for avi2vp3
here is a patch that fixes various bugs/problems with avi2vp3: 1. open() is not called with O_BINARY , this causes the program to crash or give undesired results on win32 (and maybe other platforms?), as binary mode is not default. 2. win32 does not understand chmod flags, ie: (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) 3. buffer = malloc(AVI_max_video_chunk(avifile)); for some reason, AVI_max_video...
2001 Jan 31
1
Syntax error....
....clean/vorbis-tools/oggenc/platform.c Thu Feb 1 01:25:36 2001 +++ ./vorbis-tools/oggenc/platform.c Thu Feb 1 01:23:08 2001 @@ -52,7 +58,7 @@ } #endif -#ifdef __WATCOMC__ || __BORLANDC__ +#if defined(__WATCOMC__) || defined(__BORLANDC__) void setbinmode(FILE *f) { setmode(fileno(f), O_BINARY); -- ______________________________________________________________________________ | Brian Havard | "He is not the messiah! | | brianh@kheldar.apana.org.au | He's a very naughty boy!" - Life of Brian | ------------------------------------...
2019 Aug 09
0
[PATCH] Switch to utimensat for newer POSIX versions
...#if !defined _MSC_VER && !defined __BORLANDC__ && !defined __MINGW32__ diff --git a/src/share/grabbag/file.c b/src/share/grabbag/file.c index 2c67bebf..edd835a6 100644 --- a/src/share/grabbag/file.c +++ b/src/share/grabbag/file.c @@ -27,7 +27,6 @@ #include <fcntl.h> /* for _O_BINARY */ #else #include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */ -#include <utime.h> /* for utime() */ #endif #if defined __EMX__ #include <io.h> /* for setmode(), O_BINARY */ @@ -53,11 +52,17 @@ void grabbag__file_copy_metadata(const char *sr...