提交 c7d1d1b1 编写于 作者: R Raja R Harinath 提交者: Junio C Hamano

Use dev_t for device id (st_dev) from stat in setup_git_directory_gently()

The original declaration was int, which seems to cause trouble on my
machine.  It causes spurious "filesystem boundary" errors when running
the testsuite.  The cause seems to be

  $ stat -c%d .
  2147549952

which is too large for a 32-bit int type.

Using the correct type, dev_t, solves the issue.  (Because I'm
paranoid and forgetful, I checked -- yes, Unix v7 had dev_t.)

Other uses of st_dev seem to be reasonably safe.   fill_stat_cache_info
truncates it to an 'unsigned int', but that value seems to be used only
to validate the cache, and only if USE_STDEV is defined.
Signed-off-by: NRaja R Harinath <harinath@hurrynot.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 449aeb10
......@@ -323,7 +323,8 @@ const char *setup_git_directory_gently(int *nongit_ok)
const char *gitdirenv;
const char *gitfile_dir;
int len, offset, ceil_offset, root_len;
int current_device = 0, one_filesystem = 1;
dev_t current_device = 0;
int one_filesystem = 1;
struct stat buf;
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册