-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[llvm-test-suite][tools] Fix not utility to avoid std::system #142
Conversation
tools/not.cpp
Outdated
#include <spawn.h> | ||
#include <sys/wait.h> | ||
#endif | ||
|
||
#ifdef __APPLE__ | ||
#include <TargetConditionals.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TargetConditionals.h
is only needed for TARGET_OS_IPHONE
, so I think we can drop this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the #ifdef
be changed to TARGET_OS_IPHONE
then?
Avoid using std::system on Unix systems. Some systems such as Ubuntu return a different error code from calls to std::system. Use posix_spawn to avoid having to special case these. std::system is now only used on Windows.
1e206b6
to
7acc1ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @tarunprabhu. I am no expert in those if-def, but this patch ran OK on my Ubuntu machine.
Avoid using std::system on Unix systems. Some systems such as Ubuntu return a different error code from calls to std::system. Use posix_spawn to avoid having to special case these. std::system is now only used on Windows.
@jeanPerier identified this as an issue here
@jroelofs, could you check that this doesn't cause any issues on iOS.