Skip to contentSkip to conversation

net: Return -EINTR when ctrl+c is pressed

PATCH Superseded Michal Simek 2 participants 4 messages Aug 21, 2015 – Aug 24, 2015 Networking

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: Return -EINTR when ctrl+c is pressed

Current behavior is that if CTRL+C is pressed command returns 0 that was successful which is not correct behavior.
The easiest test case is "tftpboot 80000 uImage && echo yes" and press CTRL+C. Then the second command is called which is incorrect.

Error log:
zynq-uboot> tftpb 80000 uImage && echo yes
Gem.e000b000:7 is connected to Gem.e000b000. Reconnecting to Gem.e000b000
Gem.e000b000 Waiting for PHY auto negotiation to complete....... done Using Gem.e000b000 device
TFTP from server 192.168.0.102; our IP address is 192.168.0.101 Filename 'uImage'.
Load address: 0x80000
Loading: ################
Abort
yes
zynq-uboot>

This patch adds -EINTR return value when CTRL+C is pressed.

---

Changes in v2:
- Change patch subject
- Change return value from -1 to -EINTR

 net/net.c | 1 +
 1 file changed, 1 insertion(+)
net/net.c +1 -0
index 67e0ad297cf5..2a6efd85eae2 100644
@@ -565,6 +565,7 @@ restart:
 			/* include a debug print as well incase the debug
 			   messages are directed to stderr */
 			debug_cond(DEBUG_INT_STATE, "--- net_loop Abort!\n");
+			ret = -EINTR;
 			goto done;
 		}
 
Signature · 1 line
2.5.0
#1 lore raw

PATCH v2 1/1 net: Return -EINTR when ctrl+c is pressed

Hi Michal,

Quoted 19 lines · Michal Simek

Current behavior is that if CTRL+C is pressed command returns 0 that was successful which is not correct behavior.
The easiest test case is "tftpboot 80000 uImage && echo yes" and press CTRL+C. Then the second command is called which is incorrect.

Error log:
zynq-uboot> tftpb 80000 uImage && echo yes
Gem.e000b000:7 is connected to Gem.e000b000. Reconnecting to Gem.e000b000
Gem.e000b000 Waiting for PHY auto negotiation to complete....... done Using Gem.e000b000 device
TFTP from server 192.168.0.102; our IP address is 192.168.0.101 Filename 'uImage'.
Load address: 0x80000
Loading: ################
Abort
yes
zynq-uboot>

Quoted 4 lines

This patch adds -EINTR return value when CTRL+C is pressed.

#2 lore raw

PATCH v2 1/1 net: Return -EINTR when ctrl+c is pressed

Hi Joe,

Quoted 22 lines · Joe Hershberger

Hi Michal,

Quoted 19 lines · Michal Simek

Current behavior is that if CTRL+C is pressed command returns 0 that was successful which is not correct behavior.
The easiest test case is "tftpboot 80000 uImage && echo yes" and press CTRL+C. Then the second command is called which is incorrect.

Error log:
zynq-uboot> tftpb 80000 uImage && echo yes
Gem.e000b000:7 is connected to Gem.e000b000. Reconnecting to Gem.e000b000
Gem.e000b000 Waiting for PHY auto negotiation to complete....... done Using Gem.e000b000 device
TFTP from server 192.168.0.102; our IP address is 192.168.0.101 Filename 'uImage'.
Load address: 0x80000
Loading: ################
Abort
yes
zynq-uboot>

Quoted 7 lines
Quoted 4 lines

This patch adds -EINTR return value when CTRL+C is pressed.

are you going to take it via net tree or do you want Tom to take it directly?

Thanks,
Michal

#3 lore raw

PATCH v2 1/1 net: Return -EINTR when ctrl+c is pressed

In reply to Michal Simek
Quoted 19 lines · Michal Simek

Current behavior is that if CTRL+C is pressed command returns 0 that was successful which is not correct behavior.
The easiest test case is "tftpboot 80000 uImage && echo yes" and press CTRL+C. Then the second command is called which is incorrect.

Error log:
zynq-uboot> tftpb 80000 uImage && echo yes
Gem.e000b000:7 is connected to Gem.e000b000. Reconnecting to Gem.e000b000
Gem.e000b000 Waiting for PHY auto negotiation to complete....... done Using Gem.e000b000 device
TFTP from server 192.168.0.102; our IP address is 192.168.0.101 Filename 'uImage'.
Load address: 0x80000
Loading: ################
Abort
yes
zynq-uboot>

Quoted 4 lines

This patch adds -EINTR return value when CTRL+C is pressed.

Applied to u-boot-net, thanks!
-Joe