bug-hurd
[Top][All Lists]
Advanced

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

Re: libzstd :: non-regular file test failure


From: Samuel Thibault
Subject: Re: libzstd :: non-regular file test failure
Date: Tue, 3 Dec 2024 21:15:10 +0100

Diego Nieto Cid, le mar. 03 déc. 2024 17:11:58 -0300, a ecrit:
> El mar, 3 dic 2024 a las 12:47, Samuel Thibault
> (<samuel.thibault@gnu.org>) escribió:
> >
> > Yes, the current behavior is really odd, I don't see why zstd would try
> > to remove /dev/zero...
> >
> 
> I managed to craft a small reproducer by doing the following steps:
> 
>   1. open /dev/zero
>   2. write something into it
>   3. close it
> 
> Here is the code:
> 
> ---->8-------->8----
> #include <errno.h>
> #include <stdio.h>
> #include <string.h>
> 
> int main(int argc, char ** argv)
>   {
>     FILE *file = fopen(argv[1], "wb");
>     fprintf(file, "Hello World!\n");
>     int ret = fclose(file);
>     printf("fclose ret: %d; err = %s\n", ret, strerror(errno));
>     return 0;
>   }
> ---->8-------->8----
> 
> Running it on /dev/zero gives the following result:
> 
>     $ ./fclose /dev/zero
>     fclose ret: -1; err = Success
> 
> So while errno shows no apparent error, fclose still returns -1.

Oh, that's odd indeed. Perhaps run it through rpctrace to see what
happens behind.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]