Vagabond / erlang-syslog

Erlang port driver for interacting with syslog via syslog(3)
Other
87 stars 56 forks source link

move port creation to Erlang to fix issue #9 #11

Closed vinoski closed 11 years ago

vinoski commented 11 years ago

With R16B changes related to locking within the area of port drivers seemed to result in the syslog driver hanging on the driver_create_port call. To avoid this, move port creation and closing from C into Erlang. Rework the driver control interface to simplify the open call to just the setting of the logopt and facility on a new port. Remove the opening and closing of a port in the gen_server init and terminate as that port is no longer needed to communicate with the driver. Move the open call out of the gen_server and do it in the caller's process instead.

jlouis commented 11 years ago

Looks good to me. Testing it in a production environment, hehe

istr commented 11 years ago

Hello, I tested this pull request. Works for me using R16B on a 64bit linux machine. Please pull it. Thx.

Vagabond commented 11 years ago

Can we just remove the gen_server entirely now?

vinoski commented 11 years ago

The gen_server still loads the port driver.

Vagabond commented 11 years ago

Could we just load/unload the port driver in application start/stop, though?

vinoski commented 11 years ago

Sure, you can move it. I didn't want to try to do something like that without your input.