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

Re: [MiNT] [Mint-cvs] [FreeMiNT CVS] mintlib/unix



Am 11.01.2015, 18:51 Uhr, schrieb Alan Hourihane:

Hi Helmut,

Did you commit this to the MiNTlib branch ?

Just checking if it needs the version of MiNT checking differently or
does this work with older kernels ?

-		if (rv >= 0 && __mint >= 9 && (/* __mint <= 0x109 ?
-			S_ISFIFO(sb.st_mode) : */
-			(major((dev_t) sb.st_rdev) == major(PIPE_RDEV)))
+		if (rv >= 0 && __mint >= 9 && !(iomode & O_DENYNONE)
+			&& (major((dev_t) sb.st_rdev) == major(PIPE_RDEV))

I removed the commented code and added && !(iomode & O_DENYNONE). No affect on MiNT-version.

While you're at it:

What's that:

                           if (rv >= 0) {
                                struct stat statbuf;
                                sb.st_mode = 0;

                                /*
                                   Problem: Why is sb.st_mode set to 0 and
                                   why do we check then for a fifo???
                                 */
                                if (fstat(rv,&statbuf) != 0
                                    || !S_ISFIFO(sb.st_mode)) {
                                        (void)Fclose(rv);
rv = (int)failsafe_Fopen(filename,iomode & modemask);
                                }
                            }


I mean the comment.

-Helmut

--