From 454ba630a2d70c3d40d7d7a3d61b7b95af2260b0 Mon Sep 17 00:00:00 2001
From: Victor Perszel <vlp14@inf.ufpr.br>
Date: Tue, 1 Dec 2015 21:32:54 -0200
Subject: [PATCH] receiveCD terminado

---
 include/connectionRawSocket.h | 3 +++
 src/messages.cpp              | 7 ++-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/connectionRawSocket.h b/include/connectionRawSocket.h
index bfa883b..8ac2958 100644
--- a/include/connectionRawSocket.h
+++ b/include/connectionRawSocket.h
@@ -23,6 +23,9 @@
 #include <bitset>
 #include <fstream>
 #include <map>
+#include <dirent.h>
+#include <unistd.h>
+#include <sys/stat.h>
 
 using namespace std;
 
diff --git a/src/messages.cpp b/src/messages.cpp
index fc0e7be..a0c0bb1 100644
--- a/src/messages.cpp
+++ b/src/messages.cpp
@@ -500,13 +500,11 @@ int Message::sendData(unsigned char* stringMessage){
 
 //################# MÉTODOS DA CLASSE Message --> Recebimento #################
 
-//TODAS AS MENSAGENS A PARTIR DAQUI SÃO SOMENTE PROTOTIPOS
-
-int Message::receiveCD(unsigned char* dir){
+int Message::receiveCD(unsigned char* intendedDirectory){
   int errorTest;
   SubMessage resposta;
 
-  errorTest = cdMini((char*) dir);
+  errorTest = chdir((char*) intendedDirectory);
   if(errno = ENOENT){
     if(errno = EPERM){
       if (errorTest == -1){
@@ -526,7 +524,6 @@ int Message::receiveCD(unsigned char* dir){
   }
 }
 
-//FIM DE PROTOTIPOS
 //
 int Message::receiveData(unsigned char* fileName, int size){
   int numberOfMessages, messagesCounter = 0, seqCounter;
-- 
GitLab