mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-15 22:00:06 -04:00
Revert "Make use of xasprintf instead of asprintf"
This reverts commit a143739ed2.
Our current setup doesn't allow lib/*.c files to call functions defined
in plugins/utils.[ch].
This commit is contained in:
parent
3b02d7fafb
commit
f40fc650f7
1 changed files with 3 additions and 3 deletions
|
|
@ -477,7 +477,7 @@ void np_enable_state(char *keyname, int expected_data_version) {
|
|||
this_state->state_data=NULL;
|
||||
|
||||
/* Calculate filename */
|
||||
ret = xasprintf(&temp_filename, "%s/%lu/%s/%s",
|
||||
ret = asprintf(&temp_filename, "%s/%lu/%s/%s",
|
||||
_np_state_calculate_location_prefix(), (unsigned long)geteuid(),
|
||||
this_monitoring_plugin->plugin_name, this_state->name);
|
||||
if (ret < 0)
|
||||
|
|
@ -619,7 +619,7 @@ void np_state_write_string(time_t data_time, char *data_string) {
|
|||
|
||||
/* If file doesn't currently exist, create directories */
|
||||
if(access(this_monitoring_plugin->state->_filename,F_OK)!=0) {
|
||||
result = xasprintf(&directories, "%s", this_monitoring_plugin->state->_filename);
|
||||
result = asprintf(&directories, "%s", this_monitoring_plugin->state->_filename);
|
||||
if(result < 0)
|
||||
die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
|
||||
strerror(errno));
|
||||
|
|
@ -638,7 +638,7 @@ void np_state_write_string(time_t data_time, char *data_string) {
|
|||
np_free(directories);
|
||||
}
|
||||
|
||||
result = xasprintf(&temp_file,"%s.XXXXXX",this_monitoring_plugin->state->_filename);
|
||||
result = asprintf(&temp_file,"%s.XXXXXX",this_monitoring_plugin->state->_filename);
|
||||
if(result < 0)
|
||||
die(STATE_UNKNOWN, _("Cannot allocate memory: %s"),
|
||||
strerror(errno));
|
||||
|
|
|
|||
Loading…
Reference in a new issue