Re: [PATCH] Handle the errors from chdir in set_work_tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano, Thu, Aug 02, 2007 23:58:41 +0200:
> "Alex Riesen" <raa.lkml@xxxxxxxxx> writes:
> > +		if (chdir(dir))
> > +			rel = NULL;
...
> 
> Shouldn't it die() instead, though?

Dunno. Don't like dying.

> Consolidating two of your patches, would this be Ok?

Yes, but you may consider replacing strncpy with strlcpy:

> +		memcpy(dir_buffer, dir, len - suffix_len);
> +		dir_buffer[len - suffix_len] = '\0';

strlcpy(dir_buffer, dir, len - suffix_len + 1);

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux