Opened 11 years ago

Closed 11 years ago

#4595 closed Bug (fixed)

transmission-cli does not stop on SIGINT

Reported by: dyogene Owned by: jordan
Priority: Normal Milestone: 2.50
Component: CLI Version: 2.40
Severity: Minor Keywords: backport-2.4x


transmission-cli does not stop as it is supposed to on SIGINT. Even though the output states it is stopping ("Stopping torrent..." message), the process never get out of the main loop.

After a quick investigation, it appears that it is an unfortunate inheritance of the switch from a `bitfield` implementation to a straight enum for the `tr_torrent_activity` type (see libtransmission/transmission.h). As a result, the following condition is never met in cli.c

if( st->activity & TR_STATUS_STOPPED )

explaining why we do not get out of the main loop.

It's more likely just a matter of changing the `&` operator to `==`.

Tested on archlinux.

Attachments (1)

stop_cli_on_sigint-v1.patch (373 bytes) - added by dyogene 11 years ago.
Proposed patch - V1

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by dyogene

Proposed patch - V1

comment:1 Changed 11 years ago by jordan

  • Keywords backport-2.4x added
  • Milestone changed from None Set to 2.50
  • Owner set to jordan
  • Status changed from new to assigned
  • Version changed from 2.42+ to 2.40

comment:2 Changed 11 years ago by jordan

  • Resolution set to fixed
  • Status changed from assigned to closed

Looks nice & simple to me. Committed in r13047.

Note: See TracTickets for help on using tickets.