mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Remove constant which makes the assumption that the length of
_PATH_DEV will never change. In the un-likely event that _PATH_DEV should ever change, watch(8) would have broke because of a mis-generated device name. Approved by: bmilekic (mentor) Pointed out by: Yvan Boily
This commit is contained in:
parent
927b481001
commit
0f27b90770
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129849
|
@ -154,8 +154,9 @@ open_snp(void)
|
|||
{
|
||||
char snp[] = {_PATH_DEV "snpX"};
|
||||
char c;
|
||||
int f, mode;
|
||||
int f, mode, pos;
|
||||
|
||||
pos = strlen(snp) - 1;
|
||||
if (opt_write)
|
||||
mode = O_RDWR;
|
||||
else
|
||||
|
@ -163,7 +164,7 @@ open_snp(void)
|
|||
|
||||
if (opt_snpdev == NULL)
|
||||
for (c = '0'; c <= '9'; c++) {
|
||||
snp[8] = c;
|
||||
snp[pos] = c;
|
||||
if ((f = open(snp, mode)) < 0)
|
||||
continue;
|
||||
return f;
|
||||
|
|
Loading…
Reference in a new issue