Uncrustify maxscale

See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
This commit is contained in:
Niclas Antti
2018-09-09 22:26:19 +03:00
parent fa7ec95069
commit c447e5cf15
849 changed files with 35002 additions and 27238 deletions

View File

@ -3,37 +3,37 @@
* Use getsockname and a udp connection
*/
#include<stdio.h> //printf
#include<string.h> //memset
#include<errno.h> //errno
#include<sys/socket.h> //socket
#include<netinet/in.h> //sockaddr_in
#include<arpa/inet.h> //getsockname
#include<unistd.h> //close
#include <stdio.h> // printf
#include <string.h> // memset
#include <errno.h> // errno
#include <sys/socket.h> // socket
#include <netinet/in.h> // sockaddr_in
#include <arpa/inet.h> // getsockname
#include <unistd.h> // close
#include "get_my_ip.h"
int get_my_ip(char * remote_ip, char * my_ip )
int get_my_ip(char* remote_ip, char* my_ip)
{
int dns_port = 53;
struct sockaddr_in serv;
int sock = socket ( AF_INET, SOCK_DGRAM, 0);
int sock = socket (AF_INET, SOCK_DGRAM, 0);
//Socket could not be created
// Socket could not be created
if (sock < 0)
{
return 1;
}
memset( &serv, 0, sizeof(serv) );
memset(&serv, 0, sizeof(serv));
serv.sin_family = AF_INET;
serv.sin_addr.s_addr = inet_addr( remote_ip );
serv.sin_port = htons( dns_port );
serv.sin_addr.s_addr = inet_addr(remote_ip);
serv.sin_port = htons(dns_port);
connect( sock , (const struct sockaddr*) &serv , sizeof(serv) );
connect(sock, (const struct sockaddr*) &serv, sizeof(serv));
struct sockaddr_in name;
socklen_t namelen = sizeof(name);
@ -44,15 +44,15 @@ int get_my_ip(char * remote_ip, char * my_ip )
if (p != NULL)
{
//printf("Local ip is : %s \n" , buffer);
// printf("Local ip is : %s \n" , buffer);
strcpy(my_ip, buffer);
close(sock);
return 0;
}
else
{
//Some error
printf ("Error number : %d . Error message : %s \n" , errno , strerror(errno));
// Some error
printf ("Error number : %d . Error message : %s \n", errno, strerror(errno));
close(sock);
return 2;
}