David Michael writes:
>> Huh? I am confused. Since when is it legal to give NULL as statbuf
>> to (l)stat(2)?
>>
>> Wouldn't something like this be sufficient and necessary?
>>
>> int rc = stat(path, buf);
>> if (rc)
>> return rc;
>>
>> That is, let the underlyin
On Mon, Dec 1, 2014 at 12:57 PM, Junio C Hamano wrote:
> David Michael writes:
>
>> On Mon, Dec 1, 2014 at 9:44 AM, Duy Nguyen wrote:
>>> On Sun, Nov 30, 2014 at 9:41 AM, David Michael wrote:
+int git_stat(const char *path, struct stat *buf)
+{
+ int rc;
+ rc = s
David Michael writes:
> On Mon, Dec 1, 2014 at 9:44 AM, Duy Nguyen wrote:
>> On Sun, Nov 30, 2014 at 9:41 AM, David Michael wrote:
>>> +int git_stat(const char *path, struct stat *buf)
>>> +{
>>> + int rc;
>>> + rc = stat(path, buf);
>>> + if (buf != NULL)
>>
>> It's a minor t
On Mon, Dec 1, 2014 at 9:44 AM, Duy Nguyen wrote:
> On Sun, Nov 30, 2014 at 9:41 AM, David Michael wrote:
>> +int git_stat(const char *path, struct stat *buf)
>> +{
>> + int rc;
>> + rc = stat(path, buf);
>> + if (buf != NULL)
>
> It's a minor thing, but maybe test "!rc" instead
On Mon, Dec 1, 2014 at 7:48 AM, David Michael wrote:
> On Mon, Dec 1, 2014 at 12:55 AM, Torsten Bögershausen wrote:
>> On 12/01/2014 04:40 AM, David Michael wrote:
>>>
>>> On Sun, Nov 30, 2014 at 3:16 PM, Torsten Bögershausen
>>> wrote:
>>> [snip]
Could the code be more human-readable
On Sun, Nov 30, 2014 at 9:41 AM, David Michael wrote:
> +int git_stat(const char *path, struct stat *buf)
> +{
> + int rc;
> + rc = stat(path, buf);
> + if (buf != NULL)
It's a minor thing, but maybe test "!rc" instead of "buf != NULL"?
> + buf->st_mode = mode_nat
On Mon, Dec 1, 2014 at 12:55 AM, Torsten Bögershausen wrote:
> On 12/01/2014 04:40 AM, David Michael wrote:
>>
>> On Sun, Nov 30, 2014 at 3:16 PM, Torsten Bögershausen
>> wrote:
>> [snip]
>>>
>>> Could the code be more human-readable ?
>>> static inline mode_t mode_native_to_git(mode_t native_mod
On 12/01/2014 04:40 AM, David Michael wrote:
On Sun, Nov 30, 2014 at 3:16 PM, Torsten Bögershausen wrote:
[snip]
Could the code be more human-readable ?
static inline mode_t mode_native_to_git(mode_t native_mode)
{
int perm_bits = native_mode & 0;
if (S_ISREG(native_mode))
On Sun, Nov 30, 2014 at 3:16 PM, Torsten Bögershausen wrote:
[snip]
> Could the code be more human-readable ?
> static inline mode_t mode_native_to_git(mode_t native_mode)
> {
> int perm_bits = native_mode & 0;
> if (S_ISREG(native_mode))
> return 010 | perm
David Michael writes:
> This is my most recent attempt at solving the problem of z/OS using
> different file type values than every other OS. I believe it should be
> safe as long as the file type bits don't ever need to be converted back
> to their native values (and I didn't see any instances
On 2014-11-30 03.41, David Michael wrote:
Some minor comments:
> +static inline mode_t mode_native_to_git(mode_t native_mode)
> +{
> + if (S_ISREG(native_mode))
> + return 010 | (native_mode & 0);
> + else if (S_ISDIR(native_mode))
> + return 004 | (nativ
This adds simple wrapper functions around calls to stat(), fstat(),
and lstat() that translate the operating system's native file type
bits to those used by most operating systems. It also rewrites the
S_IF* macros to the common values, so all file type processing is
performed using the translated
12 matches
Mail list logo