Mercurial > hg > Applications > docker-wrapper
changeset 7:401d1b8af977
change method name and delete newvm install from Makefile
author | taiki |
---|---|
date | Sun, 16 Nov 2014 07:01:42 +0900 |
parents | b87ef4d884af |
children | 5c26bbba0ee0 |
files | Makefile ie-docker.c |
diffstat | 2 files changed, 18 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Tue Sep 02 06:32:15 2014 -1000 +++ b/Makefile Sun Nov 16 07:01:42 2014 +0900 @@ -13,9 +13,7 @@ install: $(TARGET) newvm.py install ie-docker $(INSTALL_DIR) - install newvm.py $(INSTALL_DIR) chmod 4711 $(INSTALL_DIR)/ie-docker - chmod 755 $(INSTALL_DIR)/newvm.py clean: rm -f $(TARGET) $(TARGET2) *.o
--- a/ie-docker.c Tue Sep 02 06:32:15 2014 -1000 +++ b/ie-docker.c Sun Nov 16 07:01:42 2014 +0900 @@ -39,7 +39,7 @@ enum { NAME_LENGTH = 50, - VM_NAME_LENGTH = 50 + PS_NAME_LENGTH = 50 }; enum { @@ -154,37 +154,37 @@ void bind_name(char *name, const char *first, const char *second) { - strncat(name, first, VM_NAME_LENGTH); - strncat(name, delimiter, VM_NAME_LENGTH); - strncat(name, second, VM_NAME_LENGTH); - strncat(name, delimiter, VM_NAME_LENGTH); + strncat(name, first, PS_NAME_LENGTH); + strncat(name, delimiter, PS_NAME_LENGTH); + strncat(name, second, PS_NAME_LENGTH); + strncat(name, delimiter, PS_NAME_LENGTH); return; } void -make_vm_name(char *vm_name, const int account_type, const char *account_name, const char *vm_num) +make_ps_name(char *ps_name, const int account_type, const char *account_name, const char *vm_num) { switch(account_type) { case STUDENTS: - strncat(vm_name, students_sym, VM_NAME_LENGTH); - strncat(vm_name, delimiter, VM_NAME_LENGTH); - strncat(vm_name, account_name, 3); - strncat(vm_name, delimiter, VM_NAME_LENGTH); - strncat(vm_name, account_name, VM_NAME_LENGTH); - strncat(vm_name, delimiter, VM_NAME_LENGTH); + strncat(ps_name, students_sym, PS_NAME_LENGTH); + strncat(ps_name, delimiter, PS_NAME_LENGTH); + strncat(ps_name, account_name, 3); + strncat(ps_name, delimiter, PS_NAME_LENGTH); + strncat(ps_name, account_name, PS_NAME_LENGTH); + strncat(ps_name, delimiter, PS_NAME_LENGTH); break; case GUESTS: - bind_name(vm_name, guests_sym, account_name); + bind_name(ps_name, guests_sym, account_name); break; case MANAGERS: - bind_name(vm_name, managers_sym, account_name); + bind_name(ps_name, managers_sym, account_name); break; default : fprintf(stderr, "Error: no registered type name."); return; } - strncat(vm_name, vm_num, VM_NAME_LENGTH); + strncat(ps_name, vm_num, PS_NAME_LENGTH); } void @@ -250,10 +250,10 @@ setgid(0); setuid(0); - char *vm_name = (char *)malloc(sizeof(char) * VM_NAME_LENGTH); - vm_name[0] = '\0'; + char *ps_name = (char *)malloc(sizeof(char) * PS_NAME_LENGTH); + ps_name[0] = '\0'; if (strncmp(argv[1], "list", 4) != 0) { - make_vm_name(vm_name, account_type, name, argv[2]); + make_ps_name(ps_name, account_type, name, argv[2]); } if (argc >= 3) {