ifupdown open for no purpose
Rob Landley
rob at landley.net
Sun Feb 26 20:34:06 UTC 2006
On Sunday 26 February 2006 4:11 am, Glenn L. McGrath wrote:
> > It seems like your new one doesn't seem to truncate the existing file, so
> > if you write a shorter amount of data it could have trailing crap. Did I
> > misread?
>
> hmm, man page says open in "w" mode truncates the file to 0... not sure
> whats going on, guess i iwll have to test it :)
I use the open() stuff, not fopen(). There are separate O_CREAT, O_TRUNC, and
O_APPEND flags passed to the underlying API. I dunno which map to what in
the ansi stuff...
Ah, man page says that open without any flags is "r+". "w" is O_TRUNC.
Non-obvious, that.
Ok, looks good then.
> > Also, this patch doesn't apply on top of the previous one.
>
> Yea, it included the previous patch.
>
> Ill look into it a resend one tommorow.
If you don't get around to it I can pick the change out of the other patch.
It's small enough...
Thanks,
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list