mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-20 09:26:37 +00:00
Fix minor compilation issues on CentOS.
- ensure size_t is defined when compiling xprintf.h - declare overlay_route_record as a union field in overlay_route_record to avoid alignment issues - set the result of fwrite and fputs - support slightly older git version
This commit is contained in:
parent
fd0b7eda59
commit
bcd9575b54
@ -106,7 +106,10 @@ struct overlay_mdp_data_frame {
|
||||
uint16_t payload_length;
|
||||
int queue;
|
||||
int ttl;
|
||||
unsigned char payload[MDP_MTU-100];
|
||||
union{
|
||||
unsigned char payload[MDP_MTU-100];
|
||||
struct overlay_route_record route_record;
|
||||
};
|
||||
};
|
||||
|
||||
struct overlay_mdp_error {
|
||||
|
@ -459,7 +459,7 @@ static int app_route_print(const struct cli_parsed *parsed, struct cli_context *
|
||||
|
||||
int ofs=0;
|
||||
while(ofs + sizeof(struct overlay_route_record) <= rx.out.payload_length){
|
||||
struct overlay_route_record *p=(struct overlay_route_record *)&rx.out.payload[ofs];
|
||||
struct overlay_route_record *p=&rx.out.route_record;
|
||||
ofs+=sizeof(struct overlay_route_record);
|
||||
|
||||
if (p->reachable==REACHABLE_NONE)
|
||||
|
@ -1145,7 +1145,7 @@ static int routing_table(struct subscriber *subscriber, void *context)
|
||||
overlay_mdp_frame reply;
|
||||
bzero(&reply, sizeof(overlay_mdp_frame));
|
||||
|
||||
struct overlay_route_record *r=(struct overlay_route_record *)&reply.out.payload;
|
||||
struct overlay_route_record *r=&reply.out.route_record;
|
||||
reply.packetTypeAndFlags=MDP_TX;
|
||||
reply.out.payload_length=sizeof(struct overlay_route_record);
|
||||
r->sid = subscriber->sid;
|
||||
|
@ -113,8 +113,8 @@ int main(int argc, char **argv)
|
||||
unsigned remain = size - offset - 1;
|
||||
if (remain > sizeof buf)
|
||||
remain = sizeof buf;
|
||||
fwrite(buf, remain, 1, stdout);
|
||||
fputc('\n', stdout);
|
||||
int r=fwrite(buf, remain, 1, stdout);
|
||||
r=fputc('\n', stdout);
|
||||
offset += remain + 1;
|
||||
if (bounce <= n || bounce >= bouncemax)
|
||||
bouncedelta *= -1;
|
||||
|
@ -154,7 +154,7 @@ case "$error" in
|
||||
*[Nn]'o tags can describe'* | \
|
||||
*[Cc]'annot describe'* )
|
||||
if [ -n "$default_tag" ]; then
|
||||
commit=$(git rev-list --abbrev-commit --max-count 1 ${refspec:-HEAD})
|
||||
commit=$(git rev-list --abbrev-commit --max-count=1 ${refspec:-HEAD})
|
||||
count=$(( $(git rev-list ${refspec:-HEAD} | wc -l) - 1 ))
|
||||
echo "$default_tag-$count-g$commit$dirty"
|
||||
exit 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user