summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_unix.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year in Digia's license headersSergio Ahumada2013-01-131-1/+1
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Centralise handling & ignoring of SIGPIPE in qcore_unix_p.hThiago Macieira2013-01-051-19/+1
| | | | | | | | | | | | We had two instances of this function in the Qt source code, one clearly a copy of the other, so both had the same thread-safety issue. Instead, let's have one copy and have both write_nosignal() and sendto() call them. (cherry-picked from qtbase commit cb7d64170d62c9cda11ced7e5047070af678338b) Change-Id: I0f1354a8e9df8e6b10a02f86a940e3c6d1222087 Reviewed-by: Peter Hartmann <phartmann@rim.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix thread-safety of qt_ignore_sigpipeThiago Macieira2013-01-051-1/+5
| | | | | | | | | | | | | | The testAndSet operation would mean another thread could see the value of 1 and proceed to write(2)/sendto(2) before SIGPIPE had been ignored. If the pipe or socket were already closed by then, a SIGPIPE would be delivered to the application with its default action: terminate. (cherry-picked from qtbase commit 3f970c20f9afd5c9a1cc14d7f69882e13f6aaf1b) Change-Id: I62dc8f5fa14c1dd453d13e4053c642bd78fbc468 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Peter Hartmann <phartmann@rim.com>
* QNX: fix QProcess fd inheritanceRafael Roquetto2012-11-281-3/+18
| | | | | | | | | | | Under QNX, QProcess was not inheriting the parent's file descriptors. This patch fills in the fd_map array, containing the file descriptors to be inherited, which is passed to spawn(), accordingly. cherry-picked from qt5 226f245c71df5673b5114615fbd9ad5c285b8d3a Change-Id: Id2957c6278bc21c89234a84b364763b601ae08a1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-291-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Refactor coreservices -> ios & QT_NO_CORESERVICES -> Q_OS_IOSIan Dean2012-09-181-2/+2
| | | | | | | Similar work was done in Qt5 in Change Id3b02316 Change-Id: I392d2a5bfffb9a335f28d5dbc5ea27b800fc4487 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Update contact information in license headers.Sergio Ahumada2012-08-011-2/+2
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fixes QProcess on QNXRafael Roquetto2012-02-201-67/+55
| | | | | | | | | | | | | | This patch first re-enables childStartedPipe on QNX and uses, just like other platforms, to monitor the inferior process life cycle. This also aligns QNX-specific code logic closer to the common QProcess logic, making it unecessary to have custom versions of functions such as QProcess::waitForStarted(). The only difference that remains is the use of spawn() instead of fork(), because both fork() and vfork() do not support multi-threaded applications on QNX and will segfault. Change-Id: I8e1f9823629fcb5e7c3c128fafc2542a403b969e Reviewed-by: Sean Harmer <sh@theharmers.co.uk> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* make QProcess really work on QNXRitt Konstantin2011-06-211-21/+162
| | | | | | | a multi-threaded QNX Process can't fork properly so we call spawn() instead Merge-request: 1259 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* ifdef out mac/no_coreservices path more cleanlyOswald Buddenhagen2011-05-091-3/+2
| | | | the symbian path was also dead
* fix build on macOswald Buddenhagen2011-05-021-0/+12
| | | | environ needs to be declared properly
* make QProcessEnvironment on Unix cache converted valuesOswald Buddenhagen2011-04-291-1/+1
| | | | | | | | | values are converted between byte arrays and qstrings on demand. this makes it feasible to use the class as a generic environment container with fast reading and writing access. Reviewed-by: thiago Reviewed-by: dt
* make QProcessEnvironment::systemEnvironment() encoding-safeOswald Buddenhagen2011-04-291-0/+17
| | | | | | | | | | on unix, don't do the roundtrip over unicode. on windows, use the WinAPI unicode environment instead of the 8-bit CRT environment. Reviewed-by: thiago Reviewed-by: dt
* make QProcessEnvironment on Unix cache converted variable namesOswald Buddenhagen2011-04-291-2/+2
| | | | | | | | the converted keys also cache their hash, as they are used only for the purpose of looking up in a qhash. Reviewed-by: thiago Reviewed-by: dt
* use the Hash typedefOswald Buddenhagen2011-04-291-3/+3
| | | | | Reviewed-by: thiago Reviewed-by: dt
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into ↵Qt Continuous Integration System2011-04-181-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging: (163 commits) QLocale: Fixed double to currency string conversion on Mac. Fix qstringbuilder4 test on mac Compile on Mac. Revert "HTTP caching internals: fix logic for PreferNetwork and PreferCache" Use the qt_static_metacall in QueuedConnection Fix crash after merge of the native symbian thread branch. Fix bad merge Re-apply part of ba8e5eedf5f40091eb67dd391a7dcaf9299db2f5 Removed useless comment SSL code: introduce new error value for blacklisted certificates Disable DEF files by default for symbian-gcce. HTTP caching internals: fix logic for PreferNetwork and PreferCache Added a consistency check for number of missing symbols in elf2e32. Updated def file after symbol removal. QLocalSocket: fix abort on Windows. QStringBuilder: add operator += for QString and QByteArray Dummy commit to trigger pulse. Fix QMetaObject::indexOfSlot Fix compilation Documentation for the initilize_list constructor ...
| * Compile with QStringBuilder and QByteArrayOlivier Goffart2011-04-011-2/+2
| | | | | | | | Reviewed-by: Denis
* | Remove a race condition in SIGCHLD handler.Thiago Macieira2011-04-131-15/+10
|/ | | | | | | | If the SIGCHLD is delivered *just* as we're installing our handler, there's a race condition in the setting of the old handler. So instead rely on the OS to set it properly before it calls our handler. Reviewed-by: Olivier Goffart
* fix crash when setting QPROCESS_DEBUGHarald Fernengel2011-02-101-2/+2
| | | | don't pass QStrings to printf, but use qPrintable instead.
* Revert "Delay creation of the process manager"Harald Fernengel2011-02-041-26/+4
| | | | | | | | This reverts commit daba2c507ad42c66dafa6a29cffa94e9641e0c58. There's a potential deadlock when a QProcess is created while a QCoreApplication is instantiated but never executed, or if the main thread waits() for the child thread.
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | QProcessManager: minor optimizationRitt Konstantin2011-01-111-10/+6
| | | | | | | | | | | | | | | | | | QHash is slightly faster than QMap and should be preferred where the key order has no meaning; take() is faster than value() + remove() Reviewed-by: Olivier Goffart Merge-request: 1017
* | handle O_NONBLOCK'ed pipes specific error on write()Ritt Konstantin2011-01-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | according to the write(2) docs: When write requests greater than {PIPE_BUF} bytes to a pipe that has available space at least 1 byte, if O_NONBLOCK is set, write transfers what it can and returns the number of bytes written. When write requests of {PIPE_BUF} or less bytes to a pipe that has no enough space, or write requests for greater than {PIPE_BUF} bytes to a pipe that has no space, if O_NONBLOCK is set, write returns -1 and sets errno to EAGAIN. Merge-request: 997 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | move POSIX-specific debug to qprocess_unix.cppRitt Konstantin2011-01-111-0/+2
| | | | | | | | | | Merge-request: 997 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | Delay creation of the process managerHarald Fernengel2010-12-201-4/+26
|/ | | | | | | | The *nix process manager would create a pipe on every startup. In order to improve startup speed, the QProcessManager is now created when first needed. Reviewed-by: Robert Griebl
* Rename QTimestamp to QElapsedTimerThiago Macieira2010-03-171-4/+4
|
* Port QtCore uses of QTime as a stopwatch to QTimestamp.Thiago Macieira2010-03-171-4/+4
| | | | tst_qtimeline improvement: from 56187446 to 53915928 (callgrind)
* optimization: get rid of QString::fromUtf16() usageOswald Buddenhagen2010-02-011-1/+1
| | | | | | | | | | | | QString::fromUtf16() is slow - it does a BOM check and optionally byte swapping, which is utterly pointless when converting internal data structures which are raw utf16 in host byte order anyway. so replace it with QString::fromRawData() (for short-lived strings) or QString(const QChar *, int) (otherwise) if possible. Reviewed-by: axis Reviewed-by: mariusSO Reviewed-by: Bill King
* Update copyright year to 2010Jason McDonald2010-01-071-1/+1
| | | | Reviewed-by: Trust Me
* Make QProcess report errors from a failed subprocess start.Thiago Macieira2009-10-271-4/+14
| | | | Reviewed-by: João Abecasis
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* doc: Fixed several qdoc errors.Martin Smith2009-08-311-2/+0
|
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Add a new class for handling a process's environment variables.Thiago Macieira2009-08-211-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First of all, make it a lot easier to access individual variables by having them in an associative container (a QHash). This fixes task 232427, albeit one release later than I had originally planned. On Windows, the variable names in the environment are case-insensitive, so a direct QHash isn't a good solution. Implement code that does the uppercasing on Windows and leaves untransformed on other platforms. Since we're doing this anyways, use QByteArray on Unix systems, since, in theory, the environment could contain any random binary data, which is not representable in QString. Task-number: 232427
* | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Fix a bug in QProcess. QProcess was not reentrant on UnixBenjamin Poulain2009-08-061-1/+11
| | | | | | | | | | | | | | | | | | QProcess is supposed to be reentrant but was not on Unix. The constructor of QProcessManager could be exectued several time when QProcess is created. The construction is now protected by a mutex. Task-number: 254246 Reviewed-by: Olivier Goffart
* | Fix startDetached: the pipes must be CLOEXEC for them to work.Thiago Macieira2009-07-281-2/+2
| | | | | | | | | | | | | | | | | | In de05f9a40e41deb79daf5c4935b2645d70d7f322 I removed the fcntl that set FD_CLOEXEC because it was supposed to be set by qt_safe_pipe. Turns out that this code didn't call the wrapper function... Reviewed-by: ossi
* | Add a properly-safe version of select(2).Thiago Macieira2009-07-021-43/+37
| | | | | | | | | | | | | | | | Do the timeout handling the right and cross-platform way. The code that was in QProcess worked only on Linux, where the kernel sets the remainder in the returned timeval structure. Reviewed-By: ossi
* | Port QProcess to use the EINTR-safe and thread-safe functionsThiago Macieira2009-07-021-148/+65
| | | | | | | | Reviewed-By: ossi
* | Merge license header changes from 4.5Volker Hilsheimer2009-06-161-2/+2
|\|
| * Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | | | | | Reviewed-by: Trust Me
* | Reorganise the pipe creation code.Thiago Macieira2009-05-221-10/+8
| | | | | | | | | | | | Put all pipe creation calls together. Reviewed-by: Oswald Buddenhagen
* | Remove IRIX code.Thiago Macieira2009-05-221-7/+0
| | | | | | | | | | | | | | IRIX is no longer supported, so I won't bother fixing this part of the code. Reviewed-by: Oswald Buddenhagen
* | Merge branch '4.5'Thiago Macieira2009-05-221-16/+7
|\|
| * Don't loop around sigaction because it can't return EINTR.Thiago Macieira2009-05-221-16/+7
| | | | | | | | | | | | Asked by Oswald. Reviewed-by: Oswald Buddenhagen