Comments (5)
Ok, so I only have to worry about if ztpd received a SIGINT or a SIGTERM for this issue right?
Yep, seems like that's the only place where the event loop is stopped.
from wifi-ztp.
The event_loop_run()
return type needs to be changed from void
to int
, and the return value should indicate the status of the event loop. 0
should be returned from event_loop_run()
if the event loop exited cleanly, otherwise, an appropriate negative errno
value (eg. -EINVAL
, -ENOSYS
, etc.) should be returned.
The return value should be specified using the event_loop_stop()
function. Its signature should be changed to:
int
event_loop_stop(struct event_loop *loop, int retval)
Where retval
is the even loop return status to be returned from event_loop_run()
. This value can then be propagated to event_loop_run()
(probably through the struct event_loop
context with a new field/member).
from wifi-ztp.
Do you want the error code to only be propagated if we enter on_signal_received, or should we have the error code from other events, like dpp_start, to also be propagated up to main?
`
on_signal_received(int fd, void *context)
{
struct signalfd_siginfo siginfo;
ssize_t bytes = read(fd, &siginfo, sizeof siginfo);
if (bytes < (ssize_t)(sizeof siginfo)) {
zlog_warning("siginfo read returned too little data");
return;
}
switch (siginfo.ssi_signo) {
case SIGINT:
case SIGTERM:
event_loop_stop((struct event_loop *)context);
break;
default:
break;
}
}
`
It looks like this is the only place where event_loop_stop is being used.
from wifi-ztp.
I think it makes sense to only propagate from where event_loop_stop
is currently used since that is the only proper/expected way to stop the event loop.
from wifi-ztp.
Ok, so I only have to worry about if ztpd received a SIGINT or a SIGTERM for this issue right?
from wifi-ztp.
Related Issues (7)
- Replace custom event loop with open-source alternative HOT 3
- Undefined behavior because null terminator was not explicitly set before strtoul uses it
- Implement --version option HOT 3
- Add option to specify static DPP bootstrap key for role=enrollee
- Enable static code analysis as part of CI/CD
- possible memory leak in the future if we switch to a multithreaded ztpd HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wifi-ztp.