Commit db0b9577 db0b9577b0307cbf6e75e4ecc0d1f553f216ad9a by Sergey Poznyakoff

Handle MU_STREAM_ALLOW_LINKS.

1 parent b42efaf9
...@@ -431,11 +431,12 @@ _file_open (stream_t stream) ...@@ -431,11 +431,12 @@ _file_open (stream_t stream)
431 431
432 /* Now check that: file and fd reference the same file, 432 /* Now check that: file and fd reference the same file,
433 file only has one link, file is plain file. */ 433 file only has one link, file is plain file. */
434 if (fdbuf.st_dev != filebuf.st_dev 434 if (!(flags & MU_STREAM_ALLOW_LINKS)
435 && (fdbuf.st_dev != filebuf.st_dev
435 || fdbuf.st_ino != filebuf.st_ino 436 || fdbuf.st_ino != filebuf.st_ino
436 || fdbuf.st_nlink != 1 437 || fdbuf.st_nlink != 1
437 || filebuf.st_nlink != 1 438 || filebuf.st_nlink != 1
438 || (fdbuf.st_mode & S_IFMT) != S_IFREG) 439 || (fdbuf.st_mode & S_IFMT) != S_IFREG))
439 { 440 {
440 mu_error (_("%s must be a plain file with one link\n"), filename); 441 mu_error (_("%s must be a plain file with one link\n"), filename);
441 close (fd); 442 close (fd);
......