os.execute(command) always return -1

Issue #1042 resolved
João Lopes
created an issue

Love 0.9.2 on Ubuntu 64: os.execute() return 0. os.execute(command) return -1 despite if the command is successful or fail. Is luajit breaking lua compatibility? Or is a love bug?

Comments (10)

  1. Alex Szpakowski

    What string in particular are you passing into the function?

    EDIT: Lua 5.1's documentation on os.execute says this:

    It passes command to be executed by an operating system shell. It returns a status code, which is system-dependent. If command is absent, then it returns nonzero if a shell is available and zero otherwise.

    So it sounds like it might not think a shell is available on your system?

  2. David Serrano

    Also please run the os.execute command in a plain lua environment and see if the same value is returned. It may just be your OS. Well maybe idk. I never use os.execute

  3. João Lopes reporter

    Output for


    love 0.92:


    Lua 5.1


    Lua 5.2

    nil exit    127
    true    exit    0
  4. Bart van Strien

    Disable signal handling in threads (see issue #1042)

    I don't necessarily like having to do these extra calls whenever threads are spawned (and what happens to signals during the time signal delivery is disabled?) but it seems to fully fix os.execute.

    NOTE: Also disables signals when loading openal, as it or one of its backends spawns threads internally, and does not disable signals itself.

    → <<cset b2e868ac8ed3>>

  5. Log in to comment