diff options
| author | Cong Wang <[email protected]> | 2013-01-27 21:14:08 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2013-01-29 15:43:03 -0500 |
| commit | 604dfd6efc9b79bce432f2394791708d8e8f6efc (patch) | |
| tree | 9c3b1021318026f9300d51e6340271946d046b8f /tools/perf/scripts/python/sctop.py | |
| parent | a13d3104710184ecc43edc35a25ae8092058463f (diff) | |
pktgen: correctly handle failures when adding a device
The return value of pktgen_add_device() is not checked, so
even if we fail to add some device, for example, non-exist one,
we still see "OK:...". This patch fixes it.
After this patch, I got:
# echo "add_device non-exist" > /proc/net/pktgen/kpktgend_0
-bash: echo: write error: No such device
# cat /proc/net/pktgen/kpktgend_0
Running:
Stopped:
Result: ERROR: can not add device non-exist
# echo "add_device eth0" > /proc/net/pktgen/kpktgend_0
# cat /proc/net/pktgen/kpktgend_0
Running:
Stopped: eth0
Result: OK: add_device=eth0
(Candidate for -stable)
Cc: David S. Miller <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sctop.py')
0 files changed, 0 insertions, 0 deletions