On Thu, May 28, 2015 at 3:03 AM, Torsten Bögershausen tbo...@web.de wrote:
On 2015-05-27 15.33, Paul Tan wrote:
+/**
+ * xopen() is the same as open(), but it die()s if the open() fails.
+ */
+int xopen(const char *path, int flags, mode_t mode)
+{
+ int fd;
+
+ assert(path);
+
On Thu, May 28, 2015 at 5:53 AM, Jeff King p...@peff.net wrote:
On Wed, May 27, 2015 at 09:03:47PM +0200, Torsten Bögershausen wrote:
The original open can take 2 or 3 parameters, how about this:
int xopen(const char *path, int oflag, ... )
{
va_list params;
int mode;
A common usage pattern of open() is to check if it was successful, and
die() if it was not:
int fd = open(path, O_WRONLY | O_CREAT, 0777);
if (fd 0)
die_errno(_(Could not open '%s' for writing.), path);
Implement a wrapper function xopen() that does the above so
On Wed, May 27, 2015 at 6:33 AM, Paul Tan pyoka...@gmail.com wrote:
A common usage pattern of open() is to check if it was successful, and
die() if it was not:
int fd = open(path, O_WRONLY | O_CREAT, 0777);
if (fd 0)
die_errno(_(Could not open '%s' for
On 2015-05-27 15.33, Paul Tan wrote:
A common usage pattern of open() is to check if it was successful, and
die() if it was not:
int fd = open(path, O_WRONLY | O_CREAT, 0777);
if (fd 0)
die_errno(_(Could not open '%s' for writing.), path);
Implement a wrapper
5 matches
Mail list logo