Re: [PATCH liburing v1] test/ringbuf-read: Delete `.ringbuf-read.%d` before exit

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

 



On Mon, Sep 5, 2022 at 2:12 PM Ammar Faizi wrote:
>         fd = open(fname, O_WRONLY);
>         if (fd < 0) {
>                 perror("open");
> -               goto err;
> +               ret = 1;
> +               goto out;
>         }
>         for (i = 0; i < NR_BUFS; i++) {
>                 memset(buf, i + 1, BUF_SIZE);
>                 ret = write(fd, buf, BUF_SIZE);
>                 if (ret != BUF_SIZE) {
>                         fprintf(stderr, "bad file prep write\n");
> -                       goto err;
> +                       ret = 1;
> +                       close(fd);
> +                       goto out;
>                 }
>         }

should use T_EXIT_* for ret?

-- Viro



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux