Git Product home page Git Product logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
Why is it not correct? If you expand out the S_ISDIR macro, it basically does 
the
same thing.

Original comment by [email protected] on 1 Jul 2008 at 1:01

from distcc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
no; expand out the S_ISDIR macro, and you'll see the difference between the 
broken
code in distcc and the S_ISDIR macro is exactly what i said above: you need to 
use (m
& S_IFMT).

taking the example of S_IFDIR...

good code: ((m & S_IFMT) == S_IFDIR)
distcc:    ((m & S_IFDIR) == S_IFDIR)

if you're saying you don't understand why they're not equivalent, try 
substituting in
S_IFSOCK for m.

but, like i said, best of all is to use S_ISLNK and S_ISDIR because someone else
worries about whether they're correct, and they're more intention-revealing 
anyway.

Original comment by [email protected] on 1 Jul 2008 at 3:50

from distcc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
Ok, the results will be different, but only if stat() reports the file is both a
directory and a {fifo, char device, etc...}. The chances of that happening are 
very
rare, and if that ever happens, you probably have more serious problems to 
worry about.

I agree using the macros makes the code more readable. Please send the patch to:
distcc-patches at googlegroups.com. I don't know if patches get picked up from 
here.
See: http://lists.samba.org/archive/distcc/2008q2/003670.html

Original comment by [email protected] on 1 Jul 2008 at 7:12

from distcc.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
I've applied the patch.

Original comment by [email protected] on 30 Jul 2008 at 1:23

  • Changed state: Fixed

from distcc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.