Skip to content

Commit

Permalink
Merge pull request #351 from janowagner/remove_unused
Browse files Browse the repository at this point in the history
 Remove unused functions for otp
  • Loading branch information
jjnicola authored Jun 25, 2019
2 parents 9fcacd2 + 44621e3 commit ecd4585
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 58 deletions.
56 changes: 1 addition & 55 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,11 @@
* @brief A bunch of miscellaneous functions, mostly file conversions.
*/

#include "utils.h"

#include "../misc/network.h" /* for stream_zero */
#include "pluginscheduler.h"

#include <errno.h> /* for errno() */
#include <gvm/base/prefs.h> /* for prefs_get() */
#include <stdlib.h> /* for atoi() */
#include <string.h> /* for strchr() */
#include <string.h> /* for strcmp() */
#include <sys/ioctl.h> /* for ioctl() */
#include <sys/stat.h> /* for stat() */
#include <sys/wait.h> /* for waitpid() */

extern int global_max_hosts;
Expand Down Expand Up @@ -168,51 +162,3 @@ is_scanner_only_pref (const char *pref)
return 1;
return 0;
}

/**
* @brief Writes data to a socket.
*/
static void
auth_send (int soc, char *data)
{
unsigned int sent = 0;
gsize length;

if (soc < 0)
return;

/* Convert to UTF-8 before sending to Manager. */
data = g_convert (data, -1, "UTF-8", "ISO_8859-1", NULL, &length, NULL);
while (sent < length)
{
int n = nsend (soc, data + sent, length - sent, 0);
if (n < 0)
{
if ((errno != ENOMEM) && (errno != ENOBUFS))
{
g_free (data);
return;
}
}
else
sent += n;
}
g_free (data);
}

/**
* @brief Writes data to a socket.
*/
void
send_printf (int soc, char *data, ...)
{
va_list param;
char *buffer;

va_start (param, data);
buffer = g_strdup_vprintf (data, param);
va_end (param);

auth_send (soc, buffer);
g_free (buffer);
}
3 changes: 0 additions & 3 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,4 @@ wait_for_children1 (void);
int
is_scanner_only_pref (const char *);

void
send_printf (int, char *, ...) __attribute__ ((format (printf, 2, 3)));

#endif

0 comments on commit ecd4585

Please sign in to comment.