Re: [PATCH 3/3] use xgetcwd() get the current directory or die

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

 



Am 20.07.2014 14:45, schrieb Duy Nguyen:
On Sun, Jul 20, 2014 at 6:22 PM, René Scharfe <l.s.r@xxxxxx> wrote:
Convert several calls of getcwd() and die() to use xgetcwd() instead.
This way we get rid of fixed-size buffers (which can be too small
depending on the used file system) and gain consistent error messages.

Signed-off-by: Rene Scharfe <l.s.r@xxxxxx>
---
  builtin/init-db.c   | 17 ++++++++---------
  builtin/rev-parse.c |  6 +++---
  dir.c               | 12 ++++++++----
  trace.c             |  7 ++++---
  4 files changed, 23 insertions(+), 19 deletions(-)

There should be a 4/3 to replace the remaining getcwd with
strbuf_getcwd. But I guess we could add that to the low hanging fruit
list.

I left out the cases with the go-there-then-come-back pattern on purpose, as they hopefully can be changed to cease using getcwd() in the first place. But I'll include another example (in addition to xgetcwd()) in the reroll.

René
--
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]